A bit easier to read:
var installed = WindowController.getInstalledPlugins();
return {
installedPlugins: _.intersection(conf.SUPPORTED_EDITORS, installed),
uninstalledPlugins: _.difference(conf.SUPPORTED_EDITORS, installed),
}
mapM_ putStrLn [ if x `mod` 15 == 0 then "fizzbuzz" else if x `mod` 3 == 0 then "fizz" else if x `mod` 5 == 0 then "buzz" else show x | x <- [1..100]] |
/* | |
* TOA = TON + NPI | |
* See TS 24.008 section 10.5.4.7 for details. | |
* These are the only really useful TOA values | |
*/ | |
public static final int TOA_International = 0x91; | |
public static final int TOA_Unknown = 0x81; |
[ignore] | |
[include] | |
[libs] | |
./lib.js | |
[options] |
#!/usr/bin/env bash | |
# lintjs.sh | |
REPO_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd ) | |
JS_FILES=$(find . \ | |
-not -path '*node_modules*' \ | |
-not -path '*module-cache*' \ | |
-not -path '*/lib/*' \ | |
-not -name '*.min.js' \ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hack to block re-rendering child when parent was updated</title> | |
<script src="https://fb.me/react-0.13.0.js"></script> | |
<script src="https://fb.me/JSXTransformer-0.13.0.js"></script> | |
</head> | |
<body> | |
</body> |
def pick(d, filter_tree): | |
'''Returns a new dictionary by picking keys/values from d per filter_tree. | |
Works recursively: values in filter_tree can be either True or dictionaries | |
which are their own filters. | |
>>> d = {'a': 1, 'b': 2, 'c': {'foo': -1, 'bar': -2}, 'd': {'r': 'red', 'b': 'blue'}} | |
>>> pick(d, {'a': True, 'b': True}) | |
{'a': 1, 'b': 2} | |
>>> pick(d, {'a': True, 'b': True, 'd': True}) | |
{'a': 1, 'b': 2, 'd': {'r': 'red', 'b': 'blue'}} |
var React = require('react'); | |
var _ = require('underscore'); | |
// Catches errors in render() and returns null so that we don't | |
// break the entire React app. | |
var SafeReactComponent = function(classObj) { | |
var originalRender = classObj.render; | |
var displayName = classObj.displayName || 'unknown component'; | |
return React.createClass(_.extend(classObj, { | |
render: function() { |
A bit easier to read:
var installed = WindowController.getInstalledPlugins();
return {
installedPlugins: _.intersection(conf.SUPPORTED_EDITORS, installed),
uninstalledPlugins: _.difference(conf.SUPPORTED_EDITORS, installed),
}
#!/usr/bin/env bash | |
# A couple of handy bash functions that I have in my .bashrc: | |
# get_env uses ssh to copy an environment variable from a remote | |
# server to your current machine. Example usage: | |
# | |
# get_env SOME_VAR_NAME example.com | |
get_env () { | |
VARNAME=$1 |
// Print context of string around a point | |
func prctx(buf string, point int) { | |
if point < 0 || point >= len(buf) { | |
log.Printf("context for point: out of bounds (%d/%d)", point, len(buf)) | |
return | |
} | |
min := func(a int, b int) int { | |
if a < b { |