Skip to content

Instantly share code, notes, and snippets.

View adamwgriffin's full-sized avatar

Adam Griffin adamwgriffin

View GitHub Profile
@christoomey
christoomey / log.js
Created April 29, 2011 00:29
Wrapper for console.log
// usage: log('inside coolFunc',this,arguments);
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments) );
}
};
@twosixcode
twosixcode / gist:1988097
Created March 6, 2012 18:40
Make "Paste and Indent" the default paste in Sublime Text 2
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
@Mikhail-Zakharov
Mikhail-Zakharov / Collapse categories_Ver2.js
Last active December 28, 2015 20:28
Zendesk categories collapse widget
function HideCategory(id, IsAgent) {
// Function hides category
$j("div#category_" + id).hide('blind');
SetDownArrow(id, IsAgent);
$j.cookie('hide_category_' + id, 'yes', { expires: 180 });
$j("div#category_header_" + id).attr("onclick", "ShowCategory(" + id + "," +IsAgent+ ")");
};
@colllin
colllin / backbone-auto-routing-example.html
Last active August 10, 2018 09:03
Automatic Backbone Routing - automatically capture links with relative URLs and route them through your Backbone Router. This method does not break any fallback server-side routing, because you're still using real URLs, i.e. `<a href="/my/app/page/4">See?</a>`. If a link can't be handled by any of your routers, it will fall through so the browse…
...
<nav>
<ul>
<li>
<a href="/my/app">Home</a>
</li><li>
<a href="/my/app/posts">Posts</a>
</li><li>
<a href="/my/app/posts/1">The First Post</a>
</li>
@umpirsky
umpirsky / A.markdown
Last active August 3, 2023 18:14 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.
@jshawl
jshawl / Gruntfile.js
Last active January 18, 2023 13:52
Grunt + Sass + Autoprefixer
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options:{
style:'compressed'
},
files: {
'css/style.css' : 'scss/style.scss'
@gpessia
gpessia / Helvetica Neue stack
Created January 24, 2014 11:28
Helvetica Neue CSS font-family stack. Is there a web-safe Helvetica Neue CSS font-family stack? - See more at: http://rachaelmoore.name/posts/design/css/web-safe-helvetica-font-stack/#sthash.lt6rYYGz.dpuf
/**
* Helvetica Neue Normal (No Stretch)
*/
/* Helvetica Neue Black Font Stack */
.{font-family: "HelveticaNeueBlack", "HelveticaNeue-Black", "Helvetica Neue Black", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosBold', "Arial Black", sans-serif; font-weight:800; font-stretch:normal;}
/* Helvetica Neue Heavy Font Stack */
.{font-family: "HelveticaNeueHeavy", "HelveticaNeue-Heavy", "Helvetica Neue Heavy", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosBold', "Arial Black", sans-serif; font-weight:700; font-stretch:normal;}
@adamwgriffin
adamwgriffin / rmempty.rb
Created April 4, 2014 06:27
A one-liner to recursively delete empty directories with Ruby
Dir['**/'].reverse_each { |d| Dir.rmdir d if Dir.entries(d).size == 2 }
@NielsLeenheer
NielsLeenheer / Samsung Browser
Last active June 23, 2020 11:33
Samsung Browser
Note: Some older devices such as the Galaxy S III did not get the Chromium based browser with
the update to Android 4.2 or later. When Samsung later introduced the Galaxy S3 Neo it did get
the new browser.
Note: With the Android 4.3 release and version 1.5 of the Chromium browser, Samsung did not
enable WebAudio API for the Note 3. All other devices did get the WebAudio API.
Note: Samsung did not update the browser version with the upgrade from Android 4.3 to 4.4,
but did add getUserMedia and WebRTC functionality.
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install