Skip to content

Instantly share code, notes, and snippets.

View AdamWagner's full-sized avatar

Adam Wagner AdamWagner

View GitHub Profile
(function($){
var Responsifier = {
grid: [900, 768, 660, 560, 460, 360],
update: function() {
$('html').add('.responsive').each(function(){
var $el = $(this);
var w = $el.width();
_.each(Responsifier.grid, function(v){
if (w < v)
$el.addClass("responsive-" + v);
@thomasyip
thomasyip / common [stash] fields.py
Created July 22, 2012 04:19
Updated version of Django BigInt Patch for 64bit Primary Keys
"""
module mydjangolib.bigint_patch
A fix for the rather well-known ticket #399 in the django project.
Create and link to auto-incrementing primary keys of type bigint without
having to reload the model instance after saving it to get the ID set in
the instance.
Logs:
@omgmog
omgmog / jquery_disqus_lazyload.js
Created April 5, 2012 13:19 — forked from muratcorlu/jquery_disqus_lazyload.js
Load disqus comments when visitor scroll down page to comments
/**
* Load disqus comments when visitor scroll down page to comments
*
* Usage:
* Add a div with id "disqus_thread" and data attributes for every disqus parameter:
*
* <div id="disqus_thread" data-disqus-shortname="username" data-disqus-url="http://example.com/post/post-name/"></div>
*
* @author: Murat Corlu
* @link: https://gist.github.com/gists/2290198
@bool3max
bool3max / kitty.conf
Created March 6, 2019 11:05
My kitty terminal config
font_family Iosevka Term
bold_font Iosevka Term Bold
italic_font Iosevka Term Italic
bold_italic_font Iosevka Term Bold Italic
font_size 10.0
background #141414
foreground #F8F8F0
active_border_color #b2b2b0
inactive_text_alpha 0.85
@SamDudley
SamDudley / trelloBoardToText.js
Last active July 23, 2019 02:19
Alerts a markdown like text version of trello board's lists and cards.
// Helper function to convert node lists returned by querySelectorAll to an array
// so that we can used methods like map and filter.
function toArray(nodeList) {
let array = []
nodeList.forEach(node => array.push(node))
return array
}
// Returns a text (like markdown) representation of a trello board.
function trelloBoardAsText() {
{"title": "Mission control, elaborate",
"rules":[
{ "description": "Mission control, elaborate; requires Ctrl, Shft & arrows. Was created to make movements in Mission Control 'key-able', but works in all apps.",
"manipulators": [
{ "from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
@nkhil
nkhil / github.js
Created November 25, 2018 00:29
How to close a repo, work on it and upload it to Github as a different repo
// GitHub: git clone someone else's repository & git push to your own repository
// Create a new repository at github.com. (this is your repository)
// Give it the same name as the other repository.
// Don't initialize it with a README, .gitignore, or license.
// Clone the other repository to your local machine. (if you haven't done so already)
// git clone https://github.com/other-account/other-repository.git
// Rename the local repository's current 'origin' to 'upstream'.
@Chrisedmo
Chrisedmo / Mountain Lion tweaks
Created July 30, 2012 14:30
Mountain Lion tweaks (under the hood)
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"
@FractalWire
FractalWire / nvrp
Last active September 5, 2020 03:32
preview file with fzf and nvr
#!/bin/bash
# simple script to preview files with the help of fzf
cwd=$(pwd)
# set up
nvr --nostart -cc 'let nvrp_buffer=""'
set_variables='mime_list=( "application/json" "text/" ); mime=$(file --mime-type {} | cut -d " " -f 2)'
f_is_text='for m in ${mime_list[@]}; do test "${mime#$m}" != "$mime" && break || false; done'