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
// ==UserScript== | |
// @name Twitter Background Fixer | |
// @namespace http://your.homepage/ | |
// @version 0.1 | |
// @description Adds your custom color and image back to twitter's background. | |
// @author MightyPork | |
// @match https://twitter.com/ | |
// @grant none | |
// ==/UserScript== |
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
<?php | |
/** | |
* Dynamic dictionary object | |
* | |
* - works as object and array | |
* - countable | |
* - iterable with foreach | |
* - can be created from JSON, array or stdClass object |
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
/** | |
* Tiered lock works as a multi-level boolean / mutex. | |
* | |
* Main use case is to disable page refresh during | |
* an ongoing task, when there can be multiple such tasks. | |
*/ | |
function TieredLock() { | |
this._weight = 0; | |
this._locks = {}; | |
} |
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
<?php | |
$table = [ | |
["Hydrogen", "H", "1", "1.00794", "0.0708 (@ -253°C)", "14.01", "20.28", "79", "32", "154 (-1e)", "14.1", "14.267 (H-H)", "0.117 (H-H)", "0.904 (H-H)", "0.1815", "110.00", "2.20", "1311.3", "1, -1", "1s<sup>1</sup>", "HEX", "3.750", "1.731", "Colorless, odorless, tasteless gas", "1766 (England)", "Henry Cavendish", "Greek: hydro (water) and genes (generate)", 1, 1, 0x7FFFFFFF, 0xAAAA, 0xFFFF, 0xAAAA], | |
["Helium", "He", "2", "4.002602", "0.147 (@ -270°C)", "0.95", "4.216", "0.0", "n/a", "93", "31.8", "5.188", "n/a", "0.08", "0.152", "n/a", "n/a", "2361.3", "n/a", "1s<sup>2</sup>", "HEX", "3.570", "1.633", "Inert, colorless, odorless, tasteless gas", "1895 (Scotland/Sweden)", "Sir William Ramsey, Nils Langet, P.T.Cleve", "Greek: helios (sun).", 18, 1, 0x7FFFFFFF, 0xC000, 0x7000, 0x0], | |
["Lithium", "Li", "3", "6.941", "0.534", "553.69", "1118.15", "155", "163", "68 (+1e)", "13.1", "3.489", "2.89", "148", "84.8", "400.00", "0.98", "519.9", "1", "[He] 2s<sup>1</sup>", "BCC", "3.490", "n/a", "So |
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
source .bash_colors | |
export PROMPT_DIRTRIM=2 | |
function _branch_ps1 { | |
_branch="" | |
if [ -d .git ]; then | |
_br=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD) | |
if [ $_br == "master" ]; then |
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 | |
# Reset | |
Reset='\e[0m' # Text Reset | |
# Regular Colors | |
Black='\e[0;30m' # Black | |
Red='\e[0;31m' # Red | |
Green='\e[0;32m' # Green | |
Yellow='\e[0;33m' # Yellow |
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
<?php | |
/** | |
* Remove left padding space from all lines, | |
* while preserving indentation. | |
* | |
* @param string $txt | |
* @returns string trimmed block of text | |
*/ | |
function leftTrimBlock($txt) |
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.exports = function(grunt) { | |
grunt.file.defaultEncoding = 'utf8'; | |
grunt.file.preserveBOM = false; | |
grunt.initConfig({ | |
copy: { | |
fonts: { |
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
<?php | |
/** | |
* Group an array using a callback or each element's property/index | |
* | |
* @param array $arr array to group | |
* @param callable|string $grouper hashing function, or property/index of each item to group by | |
* @return array grouped | |
*/ | |
function groupBy(array $arr, $grouper) |
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
<?php | |
$origname = 'GPIOB_IDR'; | |
$basename = 'BB_'.$origname; | |
echo "_$basename EQU PERIPH_BB_BASE + ($origname - PERIPH_BASE) * 32\n\n"; | |
for($i=0; $i<16; $i++) { | |
echo "{$basename}_$i EQU _{$basename} + (4 * $i)\n"; |