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
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# |
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
#https://gist.github.com/Chandler/fb7a070f52883849de35 SEE HERE | |
# MIT License | |
# Copyright (c) 2016 Chandler Abraham | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
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
// wire up exec for serverless invokes with mock test data event inputs | |
require('dotenv').load(); | |
const exec = require('child_process').exec | |
, assert = require('assert') | |
const stream = require('stream'); | |
const expect = require('chai').expect; |
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
# Docker for Windows/Docker Machine is mounting C:\Users\ of your Windows to //c on the Docker host. | |
sudo touch /usr/local/bin/docker | |
sudo chmod +x /usr/local/bin/docker | |
cat EOF > /usr/local/bin/docker | |
#!/bin/bash | |
ARGS=`echo -n "$@" | sed -E 's/\/mnt\/([a-z])\//\/\/\1\//g'` | |
eval /usr/bin/docker $ARGS | |
EOF | |
## great success |
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
Show hidden characters
{ | |
"env": | |
{ | |
"es6": true, | |
"node": true | |
}, | |
"extends": "eslint:recommended", | |
"rules": | |
{ | |
"linebreak-style": ["error", "unix"], |
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
module MethodLogger | |
def self.included(base) | |
methods = base.instance_methods(false) + base.private_instance_methods(false) | |
base.class_eval do | |
methods.each do |method_name| | |
original_method = instance_method(method_name) | |
Rails.logger.info "creating override method for #{method_name} #{base}" | |
define_method(method_name) do |*args, &block| | |
Rails.logger.info "-> #{base}##{method_name}(#{args.inspect})" | |
Rails.logger.info "-- #{block}" |
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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
## Uncomment and set this to only include directories you want to watch | |
# directories %w(app lib config test spec features) \ | |
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} | |
## Note: if you are using the `directories` clause above and you are not | |
## watching the project directory ('.'), then you will want to move | |
## the Guardfile to a watched dir and symlink it back, e.g. |
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
def balance(chars: List[Char]): Boolean = { | |
def balanced(chars: List[Char], currently_open_parens: Int): Boolean = { | |
if (chars.isEmpty) currently_open_parens == 0 | |
else { | |
if(chars.head == '(') balanced(chars.tail, currently_open_parens+1) | |
else { | |
if(chars.head == ')' ) { | |
currently_open_parens > 0 && balanced(chars.tail, currently_open_parens-1) | |
} else balanced(chars.tail, currently_open_parens) | |
} |
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
/** | |
* Exercise 3 | |
*/ | |
def countChange(money: Int, coins: List[Int]): Int = { | |
def count(m: Int, sortedCoins: List[Int]) : Int = { | |
if (sortedCoins.isEmpty) 0 | |
else if (m - sortedCoins.head == 0) 1 | |
else if (m - sortedCoins.head < 0) 0 | |
else countChange(m - sortedCoins.head, sortedCoins) + countChange(m, sortedCoins.tail) | |
} |
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
AsyncTask<Void, Void, String> task = new AsyncTask<Void, Void, String>() { | |
@Override | |
protected String doInBackground(Void... params) { | |
AdvertisingIdClient.Info idInfo = null; | |
try { | |
idInfo = AdvertisingIdClient.getAdvertisingIdInfo(getApplicationContext()); | |
} catch (GooglePlayServicesNotAvailableException e) { | |
e.printStackTrace(); | |
} catch (GooglePlayServicesRepairableException e) { | |
e.printStackTrace(); |