Skip to content

Instantly share code, notes, and snippets.

View evilbuck's full-sized avatar

Evil Buck evilbuck

  • evilbuck llc
  • Hobe Sound, FL
View GitHub Profile
@evilbuck
evilbuck / bash bookmarks
Created January 17, 2012 16:14
bookmark for bash
function s {
cat ~/.sdirs | grep -v "export DIR_$1=" > ~/.sdirs1
mv ~/.sdirs1 ~/.sdirs
echo "export DIR_$1=$PWD" >> ~/.sdirs
}
function l {
source ~/.sdirs
env | grep "^DIR_" | cut -c5- | grep "^.*="
}
@evilbuck
evilbuck / tap.js
Created November 15, 2012 20:50
javascript implementation of Ruby 1.9's tap
Object.defineProperty(Object.prototype, 'tap', {
value: function(fun){
fun.call( this );
return this;
},
enumerable: false
});
// Usage:
// a = [];
@evilbuck
evilbuck / text editor bookmarklet
Created January 30, 2013 00:03
quick editor for chrome bookmarklet. has javascript syntax highlighting. Great for quick, temp snippets.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");</script>
(function() {
console.log('this does nothing');
}).call(this);
{
"_id": 2,
"conditionals": [
{
"_id": "532caaf4f308b558e8000002",
"optionId": 154,
"questionIds": [
43,
44,
45,
@evilbuck
evilbuck / main.r
Created August 10, 2017 17:31
R only output
# Run with `R --vanilla --slave --silent < main.R > myoutput.txt`
hello <- function (name) {
sprintf("Hello, %s", name);
}
print(hello("Insert name here"))
@evilbuck
evilbuck / git-selective-merge.md
Created February 27, 2019 16:03 — forked from katylava/git-selective-merge.md
git selective merge

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
/* global window document localStorage fetch alert */
// Fill in with your values
const AUTH0_CLIENT_ID = 'your-auth0-client-id-here';
const AUTH0_DOMAIN = 'your-auth0-domain-here.auth0.com';
const AUTH0_CALLBACK_URL = window.location.href; // eslint-disable-line
const PUBLIC_ENDPOINT = 'https://your-aws-endpoint-here.amazonaws.com/dev/api/public';
const PRIVATE_ENDPOINT = 'https://your-aws-endpoint-here.us-east-1.amazonaws.com/dev/api/private';
// initialize auth0 lock
@evilbuck
evilbuck / serverless.rds.example.yml
Created June 13, 2019 17:23
serverless.yml example with rds resources plus more
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
@evilbuck
evilbuck / adapter-pattern-munging-data.example.js
Last active June 27, 2019 13:33
An adapter pattern example for munging data with javascript.
const v1Data = {
metrics: {
weightLb: 400,
heightFt: 6
},
macros: {
gramsFat: 1000
}
};