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
[core] | |
excludesfile = ~/.gitignore_global | |
[user] | |
name = Adrian Cruz | |
email = [email protected] | |
signingkey = work-signing-key | |
[gpg] | |
program = /usr/local/bin/gpg | |
# Include custom .gitconfig if in personal github dir |
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
document.querySelector('video').playbackRate = 1.75; |
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
# Output the Public IP, Private IP, Instance Name | |
aws --profile default ec2 describe-instances --query 'Reservations[].Instances[].[PublicIpAddress,PrivateIpAddress,Tags[?Key==`Name`]| [0].Value]' --output=table |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) { |
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
defmodule ElixirLab.Fibonacci do | |
# Recursive | |
def fib(0), do: 1 | |
def fib(1), do: 1 | |
def fib(n), do: fib(n-1) + fib(n-2) | |
# Iterative | |
def iter_fib(0), do: 1 | |
def iter_fib(1), do: 1 | |
def iter_fib(index) do |
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 fizz_buzz(n) when 0 === rem(n, 3) and 0 === rem(n, 5) do | |
"FizzBuzz" | |
end | |
def fizz_buzz(n) when 0 === rem(n, 3), do: "Fizz" | |
def fizz_buzz(n) when 0 === rem(n, 5), do: "Buzz" | |
def fizz_buzz(n), do: n |
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
; Enable xdebug extension module | |
zend_extension=xdebug.so | |
; see http://xdebug.org/docs/all_settings | |
xdebug.remote_enable = 1 | |
xdebug.remote_host = 10.0.2.2 | |
xdebug.remote_port = 9000 | |
xdebug.idekey = "vagrant" | |
xdebug.remote_handler = dbgp |
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
{"col0":{"0":0,"1":1,"2":2,"3":3,"4":4},"col1":{"0":4,"1":3,"2":2,"3":1,"4":0},"col2":{"0":5,"1":6,"2":7,"3":8,"4":9}} |
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
SELECT | |
variance, | |
standard_deviation, | |
input | |
FROM (standardDeviation( | |
SELECT | |
'[' + GROUP_CONCAT_UNQUOTED(STRING(score)) + ']' AS json_array_input | |
FROM ( | |
SELECT | |
score |
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 is the main meat and potatoes of what I really want | |
grep -E DEBUG 2015-10-09.err | grep -E '(anonymous_id|high_scores:)'| sed -e 's/anonymous_id//g' |cut -d ' ' -f 2-| python -c "import fileinput; l0=[int(x.split(' ')[-1].strip()) for x in fileinput.input()];print('searches:{}\thigh_scoring:{}\tratio:{}'.format(l0[0],l0[1],l0[1]/float(l0[0])))" | |
# This is just a bonus to loop through a date range of my log files | |
for d in {0..15}; do today=`date -d "2015-10-09 + $d days" +'%Y-%m-%d'`; echo -n "${today} "; grep -E DEBUG ${today}.err|grep -E '(anonymous_id|high_scores:)'| sed -e 's/anonymous_id//g' |cut -d ' ' -f 2-| python -c "import fileinput; l0=[int(x.split(' ')[-1].strip()) for x in fileinput.input()];print('searches:{}\thigh_scoring:{}\tratio:{}'.format(l0[0],l0[1],l0[1]/float(l0[0])))"; done |
NewerOlder