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
'use strict'; | |
var KuduApp = require('./KuduApp'); | |
var React = require('react'); | |
var Router = require('react-router'); | |
var Route = Router.Route; | |
var Routes = ( | |
<Route handler={KuduApp}> |
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
(setq kudu-path (concat HOME "projects/kudu/kudu/src/components/*\\.js[x]?")) | |
(add-to-list 'auto-mode-alist `(,kudu-path . web-mode)) | |
(setq web-mode-content-types-alist | |
`(("jsx" . ,kudu-path))) |
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 | |
"""This script generates release notes for each merged pull request from | |
git merge-commit messages. | |
Usage: | |
`python release.py <start_commit> <end_commit> [--output {file,stdout}]` | |
For example, if you wanted to find the diff between version 1.0 and 1.2, | |
and write the output to the release notes file, you would type the | |
following: | |
`python release.py 1.0 1.2 -o file` | |
""" |
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
def concat_while(s0, s1): | |
""" | |
Concatenate s0 and s1 with a space if the length of that concatenation | |
is less than or equal to 30 characters. Otherwise it just returns s0. | |
""" | |
if len(s0) > 30: | |
return s0[:30] | |
new = ' '.join([s0, s1]) |
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
("case" non-block-expr "do" match-statements "end")) |
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
read machine_id </var/lib/dbus/machine-id | |
dbus-launch --autolaunch="$machine_id" --binary-syntax --close-stderr --exit-with-session | |
if [ -f "$HOME/.dbus/session-bus/$machine_id-${DISPLAY#:}" ]; then | |
. "$HOME/.dbus/session-bus/$machine_id-${DISPLAY#:}" | |
unset machine_id | |
printf '%s\n' "$DBUS_SESSION_BUS_ADDRESS" > "$HOME/.dbus_address" | |
fi |
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
renderResultRows: function*() { | |
const results = this.state.results; | |
for (var result in results) { | |
yield <SearchResult {...result} /> | |
} | |
}, | |
// return results.map(function(result) { | |
// return ( | |
// <SearchResult {...result} /> | |
// ); |
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
struct FizzBuzzinificationator { | |
vals: std::iter::Range<int> | |
} | |
impl FizzBuzzinificationator { | |
fn fizzbuzzmaybe (&self, x: int) -> &'static str { | |
if x % 3i == 0i && x % 5i == 0i { "FizzBuzz" } | |
else if x % 3i == 0i { "Fizz" } | |
else if x % 5i == 0i { "Buzz" } | |
else { "" } |
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 fizzbuzzinator (x: int) -> &'static str { | |
if x % 3i == 0i && x % 5i == 0i { "FizzBuzz" } | |
else if x % 3i == 0i { "Fizz" } | |
else if x % 5i == 0i { "Buzz" } | |
else { "" } | |
} | |
fn main() { | |
for i in range(0i, 100i) { | |
let val: &str = fizzbuzzinator(i); |
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
cloneState = (state, phase = 'current') -> | |
### | |
Returns a copy of a particular phase (i.e. either current or initial) | |
of the atom state. | |
Of course this assumes everything in the value is serializable to | |
JSON :) | |
### | |
JSON.parse(JSON.stringify(state[phase])) |