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
_.mixin | |
map_values: (obj, iteratee, context) -> | |
iteratee = @iteratee iteratee, context | |
@object @map obj, (v, k, o) -> [k, iteratee(v, k, o)] |
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
# Search shell history with peco: https://github.com/peco/peco | |
# Adapted from: https://github.com/mooz/percol#zsh-history-search | |
if which peco &> /dev/null; then | |
function peco_select_history() { | |
local tac=$( \ | |
(which gtac &> /dev/null && echo -n "gtac") || \ | |
(which tac &> /dev/null && echo -n "tac") || \ | |
echo -n "tail -r" \ | |
) | |
BUFFER=$(fc -l -n 1 | eval $tac | \ |
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
# https://github.com/heroku/rack-timeout/issues/76 | |
class TimeoutRecovery | |
def initialize(app, options = {}) | |
@app, @options = app, options | |
end | |
# Rack::Timeout, as of 0.2.4, raises errors that descend from the Exception | |
# class when a request takes too long - however, this is a very strong | |
# exception level and will kill Puma's worker if we let it continue down the |
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
curl -n -X PATCH https://api.heroku.com/apps/${HEROKU_APP_NAME}/formation/web \ | |
-H "Accept: application/vnd.heroku+json; version=3" \ | |
-H "Authorization: Bearer ${HEROKU_API_KEY}" \ | |
-H "Content-Type: application/json" \ | |
-d '{"quantity":1}' |
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
{ | |
"dependencies": { | |
"bluebird": "^2.9.9", | |
"commander": "^2.7.1", | |
"dotenv": "^0.5.1", | |
"glob": "^5.0.3", | |
"jsforce": "^1.4.0", | |
"jszip": "^2.5.0", | |
"lodash": "^3.5.0", | |
"shelljs": "^0.4.0", |
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
$ -> | |
$('input[type="file"]').on 'change', (event) -> | |
reader = new FileReader() | |
reader.onload = -> | |
boundary = "ljfdshflashdlfkjaklsdfjlksadjflksajdflksajdklfas" | |
blob = new Blob [ | |
[ | |
"--#{boundary}" | |
'Content-Disposition: form-data; name="json"' | |
'Content-Type: application/json; charset=UTF-8' |
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
gulp = require 'gulp' | |
sass = require 'gulp-sass' | |
sourcemaps = require 'gulp-sourcemaps' | |
gulp.task 'sass', -> | |
gulp.src './source/**/*.sass' | |
.pipe sourcemaps.init() | |
.pipe sass(indentedSyntax: true).on('error', sass.logError) | |
.pipe sourcemaps.write('.') | |
.pipe gulp.dest('./public') |
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
public class Strings { | |
public interface Replacer { | |
String apply(String match, String[] p, Integer offset, String str); | |
} | |
public static String replaceFirst(String str, String regExp, Replacer replacement) { | |
return replaceFirst(str, Pattern.compile(regExp), replacement); | |
} | |
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
<apex:page standardController="Account"> | |
<apex:outputField value="{!Account.CreatedDate}"/> | |
<apex:outputText value="{0,date}"> | |
<apex:param value="{!Account.CreatedDate}"/> | |
</apex:outputText> | |
</apex:page> |
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
public class SampleExtension { | |
public Account record { get; private set; } | |
public SampleExtension(ApexPages.StandardController controller) { | |
record = (Account) controller.getRecord(); | |
} | |
} |