View bash_aliases
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
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.restart='nginx.stop && nginx.start' | |
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist" | |
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist" | |
alias php-fpm.restart='php-fpm.stop && php-fpm.start' | |
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.restart='mysql.stop && mysql.start' | |
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log' |
View init_pdf.js.sh
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
# configs | |
JS_DIR=static/js/vendor/pdf.js | |
CSS_DIR=static/css/vendor/pdf.js | |
echo "[INFO] Clone https://github.com/mozilla/pdf.js into 'temp'" | |
git clone -b gh-pages https://github.com/mozilla/pdf.js temp | |
echo "[INFO] Init pdf.js directories" | |
rm -rf $JS_DIR | |
rm -rf $CSS_DIR |
View draft.js
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
const renderMention = (entity) => { | |
const { link, name } = entity.data.mention | |
return `<a href="${link}">${name}</a>` | |
} | |
const renderEntity = (entity) => { | |
if (entity.type === 'mention') { | |
return renderMention(entity) | |
} |
View CodeBlock.js
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 React, { Component, PropTypes } from 'react' | |
import hljs from 'highlight.js/lib/highlight' | |
import javascript from 'highlight.js/lib/languages/javascript' | |
import php from 'highlight.js/lib/languages/php' | |
import python from 'highlight.js/lib/languages/python' | |
import sql from 'highlight.js/lib/languages/sql' | |
import objectivec from 'highlight.js/lib/languages/objectivec' | |
import 'highlight.js/styles/tomorrow.css' | |
const propTypes = { |
View typeahead.twitter.js
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
this.getRemoteSuggestions = function(a, b, c, d) { | |
if (!b || !this.needsRemoteRequest(b, d)) | |
return; | |
this.request[a] || (this.attr.useThrottle ? | |
this.request[a] = utils.throttle(this.splitRemoteRequests.bind(this), this.attr.remoteThrottleInterval) : | |
this.request[a] = utils.debounce(this.splitRemoteRequests.bind(this), this.attr.remoteDebounceInterval)), | |
b.query.indexOf("@") === 0 && b.typeaheadSrc === "COMPOSE" && (b.query = b.query.substring(1), | |
b.atSignRemoved = !0), | |
this.request[a](a, b, c, d) | |
} |
View debounce.underscore.js
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
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
_.debounce = function(func, wait, immediate) { | |
var timeout, result; | |
var later = function(context, args) { | |
timeout = null; | |
if (args) result = func.apply(context, args); |
View throttle.underscore.js
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
// Returns a function, that, when invoked, will only be triggered at most once | |
// during a given window of time. Normally, the throttled function will run | |
// as much as it can, without ever going more than once per `wait` duration; | |
// but if you'd like to disable the execution on the leading edge, pass | |
// `{leading: false}`. To disable execution on the trailing edge, ditto. | |
_.throttle = function(func, wait, options) { | |
var timeout, context, args, result; | |
var previous = 0; | |
if (!options) options = {}; |
View vl.js
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
alert(1); |
View secrets-entrypoint.sh
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 | |
# Check that the environment variable has been set correctly | |
if [ -z "$SECRETS_BUCKET_NAME" ]; then | |
echo >&2 'error: missing SECRETS_BUCKET_NAME environment variable' | |
exit 1 | |
fi | |
# Containers that are running on your container instances | |
# have access to all of the permissions that are supplied to the container instance role. |
View Dockerfile
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
# s3 bucket for storing secrets | |
ENV SECRETS_BUCKET_NAME oms-services.secrets | |
# pull secrets data | |
COPY secrets-entrypoint.sh /secrets-entrypoint.sh | |
RUN chmod +x /secrets-entrypoint.sh | |
ENTRYPOINT ["/secrets-entrypoint.sh"] | |
# ./cyclops.conf is pulled from S3 | |
CMD cyclops -c ./cyclops.conf -p 80 |
OlderNewer