Skip to content

Instantly share code, notes, and snippets.

@ubergoober
ubergoober / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ubergoober
ubergoober / rmAndroid
Created September 4, 2015 07:04
OSX - Remove all of Android Studio and Android SDK
#Gleemed from stackoverflow: http://stackoverflow.com/questions/17625622/how-to-completely-uninstall-android-studio
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
#if you would like to delete all projects:
@ubergoober
ubergoober / rmAtom
Created September 4, 2015 07:06
OSX - Remove all of Atom IDE
#Gleemed from atom site: https://discuss.atom.io/t/how-to-completely-uninstall-atom-for-mac/9084/12
rm -rf ~/.atom
rm /usr/local/bin/atom
rm /usr/local/bin/apm
rm ~/Library/Preferences/com.github.atom.plist
rm -rf ~/Library/Application Support/com.github.atom.ShipIt
rm -rf ~/Library/Application Support/Atom/
@ubergoober
ubergoober / prettyJSON
Created September 15, 2015 17:12
Convert ugly json to pretty json using nodejs commandline.
# reference stackoverflow : http://stackoverflow.com/questions/352098/how-can-i-pretty-print-json
node -e "console.log(JSON.stringify(JSON.parse(require('fs').readFileSync(process.argv[1])), null, 4));" [FILENAME]
@ubergoober
ubergoober / README.md
Created October 13, 2015 19:34 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@ubergoober
ubergoober / findValueInArrayOfObjects.js
Last active February 3, 2016 17:47
Check if value for a key exists in an array of objects.
var arrayOfObjects = [{key1: 'foo1', key2: 'bar1'}, {key1: 'foo2', key2: 'bar2'}];
var keyNameToCheck = "key1";
var valueToFind = 'foo1';
function doesArrayOfObjectsContainValueForKey(array, keyName, value){
var res = array.filter(function(obj){
return obj[keyName] === value;
});
return res.length === 0 ? false : true;

##The Alpha M. Eating Plan Credits/Source: Aaron Marino, iamalpham.com. Documenting here for prosperity. At the time this was posted, this text is freely available on his web site.

The strategy is pretty straight-forward. Follow the formula by picking items and portions from the appropriate categories. Your metabolism will get rolling. If you feel you need more food, simply increase portion size.

######Beverage:

  • Water
@ubergoober
ubergoober / DefaultKeyBinding.dict
Created March 31, 2016 16:56
OSX Home/End remapping
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}
@ubergoober
ubergoober / JSONObject.cs
Created April 14, 2016 13:09 — forked from bingomanatee/JSONObject.cs
the JSONObject component. Taken from the Unity Wiki
#define PRETTY //Comment out when you no longer need to read JSON to disable pretty print system-wide
#define USEFLOAT //Use floats for numbers instead of doubles (enable if you're getting too many significant digits in string output)
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
* http://www.opensource.org/licenses/lgpl-2.1.php
* JSONObject class
When you get an error code in with the domain kCFStreamErrorDomainSSL, you can generally find the error codes in SecureTransport.h which is in /System/Library/Frameworks/Security.framework. Here are the error codes:
enum {
errSSLProtocol = -9800, /* SSL protocol error */
errSSLNegotiation = -9801, /* Cipher Suite negotiation failure */
errSSLFatalAlert = -9802, /* Fatal alert */
errSSLWouldBlock = -9803, /* I/O would block (not fatal) */
errSSLSessionNotFound = -9804, /* attempt to restore an unknown session */
errSSLClosedGraceful = -9805, /* connection closed gracefully */
errSSLClosedAbort = -9806, /* connection closed via error */