This file contains hidden or 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
#!/usr/bin/env python | |
from __future__ import print_function | |
import phue | |
import re | |
import subprocess | |
import sys | |
import logging |
This file contains hidden or 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
#!/usr/bin/env python | |
"""Get closest named colour according to XKCD's colour naming survey | |
`http://xkcd.com/color/rgb/`. | |
rgb.txt from `http://xkcd.com/color/rgb.txt` must reside alongside this script. | |
Exceptions are made for true black and true white: these are omitted from the | |
searched colours. "black" and "white" are returned only if the queried colour is | |
true black or true white. |
This file contains hidden or 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
--------------------------------------------------------------------------- | |
--- Mirrored "left" tile layout for awful | |
-- | |
-- This is the same as awful's awful.layout.suit.tile.left but with the | |
-- secondary columns' order reversed. | |
-- | |
-- With two columns, awful.layout.suit.tile.left has | |
-- | |
-- +-----+-----+-----------+ | |
-- | | | | |
This file contains hidden or 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
import autoprefixer from 'autoprefixer'; | |
import mqpacker from 'css-mqpacker'; | |
import path from 'path'; | |
import webpack from 'webpack'; | |
let srcDir = path.join(__dirname, 'src'); | |
let globalStylesDir = path.join(srcDir, 'scss'); | |
let config = { | |
context: srcDir, |
This file contains hidden or 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
[ | |
{ | |
"backcolor": "#ffffff", | |
"name": "Dvorak LCD", | |
"author": "Bart Nagel", | |
"background": { | |
"name": "Maple orange", | |
"style": "background-image: url('/bg/wood/maple-orange.jpg');" | |
}, | |
"switchMount": "alps", |
This file contains hidden or 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
import requests | |
class SeekableURL(object): | |
def __init__(self, url): | |
self._url = url | |
self._pointer = 0 | |
self._filesize = None | |
self._is_seekable = None | |
self._got_stats = False | |
self._stream = None |
This file contains hidden or 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
# Step 01 | |
# per https://gitlab.com/gitlab-org/gitlab-ce/issues/13357#note_4857268 | |
gdb | |
attach <PID> | |
redirect_stdout | |
eval("puts Kernel.caller.join(\"\\n\")") | |
# Step 02 | |
gdb | |
attach <PID> |
This file contains hidden or 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
<?php | |
namespace Tremby\Twig\Extension; | |
use Twig_Extension; | |
use Twig_SimpleFilter; | |
/** | |
* Filter to leave a variable alone if it's array, | |
* pass an empty array if the variable was missing, | |
* and wrap anything else in an array. |
This file contains hidden or 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
test2layout.twig 1 [foo] [bar] | |
test2page.twig 1 [foo] [] | |
test2.twig 1 [foo] [] [baz] | |
test2template.twig 1 [] [] [baz] | |
test2.twig 2 [] [] [baz] | |
test2template.twig 2 [] [] [baz] | |
test2.twig 3 [foo] [] [baz] | |
test2page.twig 2 [foo] [] | |
test2layout.twig 2 [foo] [bar] |
This file contains hidden or 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
$.fn.removeClassRegex = function(regex) { | |
return this.removeClass(function(index, classes) { | |
return classes.split(/\s+/).filter(function(c) { | |
return regex.test(c); | |
}).join(' ') | |
}); | |
}; | |
$.fn.hasClassRegex = function(regex) { | |
var has = false; | |
this.each(function() { |