Skip to content

Instantly share code, notes, and snippets.

Andrew Lunny alunny

View GitHub Profile
View twitter-mustache-loader.js
var Hogan = require('./twitter-hogan');
var renderOptions = { asString: true, sectionTags: [{ o: '_i', c: 'i' }] };
var translateMustache = require('./translate-mustache');
function extractPartials(tmpl) {
// need eval to pull the partials out of the Hogan-generated string
/* eslint-disable no-eval */
var hoganParams = eval(`(${tmpl})`);
/* eslint-enable no-eval */
var partialNames = [];
@alunny
alunny / idealOutput.js
Last active Dec 12, 2016
webpack plugin question
View idealOutput.js
var _ = require('i18n_library');
modules.exports = {
literalPhrase: "Hola Sean",
parameterizedPhrase: _("Hola {{person}}", { person: "Sean" })
}
View is.js
spymaster: PropTypes.bool.isRequired,
double: PropTypes.string,
toggleSpymaster: PropTypes.func
}
window.addEventListener('deviceorientation', this.onDeviceOrientation)
}
View gist:0235e8560d2c15364e89
$ npm install
> fsevents@1.0.9 install /Users/alunny/dev/tmp/rq/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/alunny/dev/tmp/rq/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node" is installed via remote
require-from-twitter@0.0.1 /Users/alunny/dev/tmp/rq
├─┬ babel-cli@6.6.5
│ ├─┬ babel-polyfill@6.7.4
│ │ ├── babel-regenerator-runtime@6.5.0
View formatterFn.diff
diff --git a/src/unit.js b/src/unit.js
index 5ad4499..3f35708 100644
--- a/src/unit.js
+++ b/src/unit.js
@@ -2,17 +2,21 @@ define([
"./core",
"./common/validate/parameter-presence",
"./common/validate/parameter-type/number",
+ "./common/validate/parameter-type/plain-object",
"./unit/format",
View gist:e71ba6d02af046fe4275
Sub LockAllVisibleToolbars()
Dim cb As CommandBar
For Each cb In CommandBars
If cb.Visible = True Then
cb.Protection = msoBarNoChangeDock + _
msoBarNoChangeVisible + _
msoBarNoCustomize + _
msoBarNoMove + _
msoBarNoResize
View gist:488f132969c1b257a342
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:93:in `load'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:89:in `load'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:86:in `each'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:86:in `load'
from ./config/deploy.rb:17:in `load'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /home/alunny/.rvm/gems/RUBY_VERSION/gems/capistrano/lib
View .tmux.conf
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
# important!
bind-key d confirm-before -p "detach-client? (NO) (y/n)" detach-client
set -g status-bg black
set -g status-left-fg green
View gist:6983659
if (value === 'onething') {
return correctValue;
} else {
omfg.this.should.never.happen
}
View checkmc.sh
#!/bin/bash
while true
do
curl http://eztv.it | grep "href=\"\/ep\/.*\/masterchef"
if [ $? -ne 0 ]
then
echo "not found at `date`"
sleep 30
else
You can’t perform that action at this time.