Skip to content

Instantly share code, notes, and snippets.

@genekogan
genekogan / imagenet_classes_list.txt
Created November 23, 2018 09:00
An indexed list of ImageNet class names
0) tench, Tinca tinca
1) goldfish, Carassius auratus
2) great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
3) tiger shark, Galeocerdo cuvieri
4) hammerhead, hammerhead shark
5) electric ray, crampfish, numbfish, torpedo
6) stingray
7) cock
8) hen
9) ostrich, Struthio camelus
@luke161
luke161 / AutoIncrementBuildNumber.cs
Created November 7, 2017 15:38
Unity editor extension to increment iOS build number after each build.
using UnityEditor;
using UnityEditor.Callbacks;
public class AutoIncrementBuildNumber
{
[PostProcessBuild]
public static void OnBuildComplete(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget==BuildTarget.iOS) {
PlayerSettings.iOS.buildNumber = (int.Parse (PlayerSettings.iOS.buildNumber) + 1).ToString();
@HalfdanJ
HalfdanJ / alphafbo.cpp
Created May 25, 2016 19:00
ofFbo with premultiplied alpha
// Kudos to armadilly
fbo.begin();
///pre-multiply background color of the fbo for correct blending!
ofClear(ofColor(fboBgColor * (fboBgColor.a / 255.) , fboBgColor.a));
//Set this blending mode for anything you draw INSIDE the fbo
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
//your draw code here!
fbo.end();
@waldobronchart
waldobronchart / UnityPlatformSwitcher.cs
Last active October 12, 2023 09:13
A simple fast platform switcher for Unity
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
public class PlatformSwitcher
{
[MenuItem("Platform/PC, Mac and Linux Standalone")]
static void SwitchPlatformToDesktop()
{
@bnagy
bnagy / gpgmutt.md
Last active March 30, 2024 07:52
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@natecook1000
natecook1000 / NSTimer+Closure.swift
Last active January 6, 2024 07:23
Scheduled NSTimer with a Swift closure
extension NSTimer {
/**
Creates and schedules a one-time `NSTimer` instance.
- Parameters:
- delay: The delay before execution.
- handler: A closure to execute after `delay`.
- Returns: The newly-created `NSTimer` instance.
*/
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 25, 2024 22:55
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@zhuochun
zhuochun / README.md
Last active June 14, 2023 17:46
List all posts, tags and categories in Jekyll. https://github.com/zhuochun/md-writer

List all posts, tags and categories in Jekyll.

Octopress users: if you found " is escaped in the generated JSON file, please change them to \". Refer to this issue.

@d3lta-v
d3lta-v / ROT13+ROT5.js
Last active July 14, 2020 11:54
Simple Javascript implementation of ROT13+ROT5 ciphers.
// Simple ROT13+ROT5 cipher (Javascript implementation)
// Copyright StatiX Industries 2013 (MIT License)
//This is the alphabet array
var alphaBetString = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z";
var alphaBetTable = alphaBetString.split(" ");
//This is the lookup table/array for the ROT13 characters
var rot13String = "N O P Q R S T U V W X Y Z A B C D E F G H I J K L M n o p q r s t u v w x y z a b c d e f g h i j k l m";
var rot13Table = rot13String.split(" ");
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,