This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set strJS to " | |
var xpathResults = document.evaluate('//*[@class=\\'r\\']/a', document, null, 0, null), | |
lst = [], | |
oNode; | |
while (oNode = xpathResults.iterateNext()) { | |
lst.push([ | |
'[', | |
oNode.text, | |
'](', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
OlderNewer