Skip to content

Instantly share code, notes, and snippets.

@yasirkula
yasirkula / SceneViewUIObjectPickerContextWindow.cs
Last active May 10, 2024 23:22
Select the UI object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2021_2_OR_NEWER
using PrefabStage = UnityEditor.SceneManagement.PrefabStage;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
@ashecret
ashecret / almostIncreasingSequence.js
Last active May 10, 2024 23:22
CodeFight: Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the array.
function almostIncreasingSequence(sequence) {
var found = 0;
for (var i=0;i<sequence.length;i++) {
if(sequence[i] <= sequence[i-1]) {
found++;
// check if more than one nonincreasing found
if(found > 1) return false;
// check if second previous number is equal to / bigger than current number
[
{
"name": "ANDORA",
"lada": "376"
},
{
"name": "GABON",
"lada": "241"
},
{
@kijart
kijart / trakt-backup.sh
Last active May 10, 2024 23:19 — forked from darekkay/trakt-backup.php
Trakt.tv backup bash script
#!/usr/bin/env bash
# Trakt backup script (note that user profile must be public)
# Trakt API documentation: http://docs.trakt.apiary.io
# Trakt client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
set -e
# custom variables
API_KEY="CLIENT_API_KEY"
@parmentf
parmentf / GitCommitEmoji.md
Last active May 10, 2024 23:18
Git Commit message Emoji
@darekkay
darekkay / trakt-backup.php
Last active May 10, 2024 23:16
Trakt.tv backup script
<?php
/*
Backup script for trakt.tv (API v2).
Live demo: https://darekkay.com/blog/trakt-tv-backup/
*/
// create a Trakt app to get a client API key: http://docs.trakt.apiary.io/#introduction/create-an-app
$apikey = "CLIENT_API_KEY";
@visualblind
visualblind / sysctl-tunables
Created April 5, 2021 23:54 — forked from mizhka/sysctl-tunables
FreeBSD 13-GENERIC-CURRENT tunables
kern.maxproc: Maximum number of processes
kern.ngroups: Maximum number of supplemental groups a user can belong to
kern.ipc.shm_allow_removed: Enable/Disable attachment to attached segments marked for removal
kern.ipc.shm_use_phys: Enable/Disable locking of shared memory pages in core
kern.ipc.shmall: Maximum number of pages available for shared memory
kern.ipc.shmseg: Number of segments per process
kern.ipc.shmmni: Number of shared memory identifiers
kern.ipc.shmmin: Minimum shared memory segment size
kern.ipc.shmmax: Maximum shared memory segment size
kern.ipc.semaem: Adjust on exit max value
@Earnestly
Earnestly / c99_ub_list.rst
Last active May 10, 2024 23:14
C99 List of Undefined Behavior (193 Cases)

C99 List of Undefined Behavior

From N1256: (See http://port70.net/~nsz/c/c99/n1256.html#J.2)

  • A "shall" or "shall not" requirement that appears outside of a constraint is violated (clause 4).
  • A nonempty source file does not end in a new-line character which is not immediately preceded by a backslash character or ends in a partial preprocessing token or comment (5.1.1.2).
  • Token concatenation produces a character sequence matching the syntax of a universal character name (5.1.1.2).
  • A program in a hosted environment does not define a function named main using one of the specified forms (5.1.2.2.1).
  • A character not in the basic source character set is encountered in a source file, except in an identifier, a character constant, a string literal, a header name, a comment, or a preprocessing token that is never converted to a token (5.2.1).
  • An identifier, comment, string literal, character constant, or header name contains an invalid multibyte character or does not
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active May 10, 2024 23:13
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.