Skip to content

Instantly share code, notes, and snippets.

@CDillinger
CDillinger / FuzzyMatch.cs
Last active July 25, 2023 09:17
C# Implementation of Fuzzy Match
// LICENSE
//
// This software is dual-licensed to the public domain and under the following
// license: you are granted a perpetual, irrevocable license to copy, modify,
// publish, and distribute this file as you see fit.
using System;
using System.Collections.Generic;
public static class FuzzyMatcher
@jimfleming
jimfleming / GrabScreenSwatch.cs
Created December 7, 2014 06:50
Uses an internal Unity3D utility function to grab chunks of the screen for blurring.
public static class GrabScreenSwatch {
public static Texture GrabScreenSwatch(Rect rect) {
int width = (int)rect.width;
int height = (int)rect.height;
int x = (int)rect.x;
int y = (int)rect.y;
Vector2 position = new Vector2(x, y);
Color[] pixels = UnityEditorInternal.InternalEditorUtility.ReadScreenPixel(position, width, height);
@Geri-Borbas
Geri-Borbas / AudioFormatDescription.m
Last active August 29, 2015 14:00
Get a human readable `AudioStreamBasicDescription` description.
-(NSString*)descriptionForAudioFormat:(AudioStreamBasicDescription) audioFormat
{
NSMutableString *description = [NSMutableString new];
// From https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/AudioUnitHostingGuide_iOS/ConstructingAudioUnitApps/ConstructingAudioUnitApps.html (Listing 2-8)
char formatIDString[5];
UInt32 formatID = CFSwapInt32HostToBig (audioFormat.mFormatID);
bcopy (&formatID, formatIDString, 4);
formatIDString[4] = '\0';
@anateus
anateus / Monokai.tmTheme
Created May 10, 2012 22:07 — forked from chrisyip/Monokai.tmTheme
Monokai for Sublime Text: Markdown supported + some additional element differentiation
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array><dict><key>name</key><string>mon_color</string><key>scope</key><string>mcol_CB4B16FF</string><key>settings</key><dict><key>background</key><string>#CB4B16FF</string><key>caret</key><string>#FFFFFFFF</string><key>foreground</key><string>#FFFFFFFF</string></dict></dict>
<dict><key>name</key><string>mon_color</string><key>scope</key><string>mcol_839496FF</string><key>settings</key><dict><key>background</key><string>#839496FF</string><key>caret</key><string>#000000FF</string><key>foreground</key><string>#000000FF</string></dict></dict>
<dict><key>name</key><string>mon_color</string><key>scope</key><string>mcol_F8F8F2FF</string><key>settings</key><dict><key>background</key><string>#F8F8F2FF</string><key>caret</key><string>#000000FF</string><key>foreground</key><