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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# <bitbar.title>Active GPU</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Eric Ripa</bitbar.author> | |
# <bitbar.author.github>eripa</bitbar.author.github> | |
# <bitbar.desc>Displays an image based on the active GPU in multi-GPU machines, such as the MacBook Pro</bitbar.desc> | |
# <bitbar.image>http://i.imgur.com/v2MuPOi.png</bitbar.image> | |
# <bitbar.dependencies></bitbar.dependencies> | |
# <bitbar.abouturl></bitbar.abouturl> |
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
export function mapValues<A, B>( | |
obj: { [key: string]: A }, | |
f: (x: A) => B | |
): { [key: string]: B } { | |
const rv: { [key: string]: B } = {} | |
for (const key in obj) { | |
if (obj.hasOwnProperty(key)) { | |
rv[key] = f(obj[key]) | |
} |
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
import router from './router.jsx'; | |
import A from './A.jsx'; | |
import B from './B.jsx'; | |
import C from './C.jsx'; | |
router.on('/a', () => { React.render(<A />, document.body); }); | |
router.on('/b', () => { React.render(<B />, document.body); }); | |
router.on('/c', () => { React.render(<C />, document.body); }); | |
router.init(); |
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
// http://stackoverflow.com/a/5624139/237285 | |
function rgbToHex(r, g, b) { | |
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); | |
} | |
function hexToRgb(hex) { | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? [ | |
parseInt(result[1], 16), | |
parseInt(result[2], 16), |
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
var els = document.querySelectorAll("#browse_result_area [data-bt='{\"ct\":\"title\"}'] a"); | |
var ret = "" | |
for(var i=0; i<els.length; i++) { | |
ret += /\w+ \w+/.exec(els[i].textContent) + ","; | |
} |
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/sh | |
set -ex | |
cd /home/public | |
# Download Wordpress | |
wget http://wordpress.org/latest.tar.gz | |
tar -xf latest.tar.gz | |
rm latest.tar.gz | |
mv wordpress/* . | |
rmdir wordpress |
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
*.io.run |
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
#include "debug.h" | |
debug_stream debug; |
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 | |
# Fail fast. | |
set -e | |
# Debug. | |
# set -x | |
function indent() { | |
c='s/^/ /' |
This file has been truncated, but you can view the full file.
NewerOlder