Skip to content

Instantly share code, notes, and snippets.

@lancebecker
lancebecker / gist:652835
Created October 29, 2010 03:22
Setting an NSTextField text color to black
-(void) styleTextField {
[textField setTextColor:[NSColor blackColor]];
}
@lancebecker
lancebecker / Vim & Ctags
Created December 3, 2011 21:19
Adding Exuberant CTag support to VIM
Ctags will create a tags file, so make sure to add it to your global .gitignore file and never commit it
# INSTALLATION
### Install exuberant ctags with brew
brew install ctags
### Decommission system ctags
function getQueryParam( param ) {
let loc = document.location.search
if ( document.location.search && param ) {
return document.location.search.split( param + '=' ).pop()
}
}
getQueryParam( 'key' )
@lancebecker
lancebecker / .json
Last active February 28, 2019 22:23
vscode configuration
{
"workbench.iconTheme": "material-icon-theme",
"workbench.sideBar.location": "left",
"workbench.editor.enablePreview": false,
"workbench.startupEditor": "newUntitledFile",
"workbench.colorTheme": "Snazzy Operator",
"workbench.colorCustomizations": {
"editorError.border": "#f08080"
},
if ( pizza ) {
goToHappyPlace()
}
if ( pizza ) {
goToHappyPlace()
}
+angular.module( 'gizmos.filters' ).filter( 'indexToAlphabet', [
+ function() {
+ return function( index, lettercase ) {
+ var index, alphabet, len
+
+ alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ len = ( alphabet.length - 1 )
+
+ if ( lettercase === 'lowercase' ) {
+ alphabet = alphabet.toLowerCase()
@lancebecker
lancebecker / gist:7240579
Created October 30, 2013 21:26
Colored output for console.log
console.log("%c %s", "color:white;background:gray;font-size:12px",a);
@lancebecker
lancebecker / gist:7238915
Created October 30, 2013 19:41
delete remote branch
git push origin :remotebranchtodelete
@lancebecker
lancebecker / gist:6295014
Created August 21, 2013 14:16
GAQ in one data prop
<a href="#" data-track='{"category":"categoryName", "action":"click", "label":"labelName"}'>
TrackingManager.prototype._standardGaq = function(o) {
return _gaq.push(['_trackEvent', o.category, o.action, o.label]);
};