Skip to content

Instantly share code, notes, and snippets.

View aaroncrespo's full-sized avatar
🤷‍♂️
¯\_(ツ)_/¯

Aaron Crespo aaroncrespo

🤷‍♂️
¯\_(ツ)_/¯
View GitHub Profile
// Type-safe State Machine with Phantom Type May 2022 @AtarayoSD
import Foundation
protocol State {}
// Transitions
protocol TransferableToB {}
protocol TransferableToC {}
protocol TransferableToD {}
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active October 26, 2025 08:45
A badass list of frontend development resources I collected over time.
@mikeflynn
mikeflynn / chromebook_pixel_setup.md
Last active December 17, 2015 11:38
My various Chromebook Pixel setup notes

Chromebook Pixel Configuration

What does this do? Good question. What you will end up with is essentially Chrome OS and Ubuntu (with KDE) running side by side.

1. Get in to developer mode

Hold down ESC + REFRESH + POWER, when it reboots hit CTRL + D, and ENTER to confirm.

(You will have to hit CTRL + D at ever boot when you see the scary dev mode OS screen.)

@mattt
mattt / uiappearance-selector.md
Last active October 7, 2025 13:32
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@albertein
albertein / highlight.js
Created July 5, 2012 00:48
Selection highlighting
function getSelectedText(){
if(window.getSelection){
return window.getSelection().toString();
}
else if(document.getSelection){
return document.getSelection();
}
else if(document.selection){
return document.selection.createRange().text;
}
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);