Skip to content

Instantly share code, notes, and snippets.

View douglasjarquin's full-sized avatar

Douglas Jarquin douglasjarquin

View GitHub Profile
@ Wealth Defined
MONTHLY = $100,000 = $100,000.00
INTEREST = 6 = 6
BALLER = INTEREST% of what is MONTHLY = $1,666,666.67
Total in the bank: INTEREST% of what is BALLER = $27,777,777.78

Keybase proof

I hereby claim:

  • I am douglasjarquin on github.
  • I am douglasjarquin (https://keybase.io/douglasjarquin) on keybase.
  • I have a public key whose fingerprint is 2E7C F0B1 5655 6EB6 375E 5FED 76CA E56D CD11 BC96

To claim this, I am signing this object:

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@douglasjarquin
douglasjarquin / remove-duplicate-uids.rb
Created December 25, 2013 03:48
Remove duplicate passwd file lines by uid
#!/usr/bin/env ruby
=begin
How would I write code to delete lines from a passwd file that has duplicate uids?
Example entry from the passwd file looks like:
`nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false`
Bonus points if you can do it in a single pass through the file.
=end
@douglasjarquin
douglasjarquin / prime-data.rb
Last active December 25, 2015 15:29
Code Kata for Oct 15th
#!/usr/bin/env ruby
require 'prime'
the_numbers = Hash.new
number_injection = Proc.new &(->(number) { the_numbers[number] = 'douglas' } )
Prime.first(10).each &number_injection
puts the_numbers
@douglasjarquin
douglasjarquin / bad-filters.sql
Created July 31, 2013 19:00
List offending HelpSpot filters
select sFilterName, sFname, sLname, sEmail from HS_Filters inner join HS_Person hsp on hsp.`xPerson` = HS_Filters.`xPerson` where `HS_Filters`.`xFilter` in (select xFilter from HS_Filter_Performance where dTime > 99)
!#/usr/bin/env ruby
=begin
1. Write a program that prints the numbers from 1 to 100.
2. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz".
3. For numbers which are multiples of both three and five print "FizzBuzz".
=end
100.times do |count = 0|
if count % 3 == 0 && count % 5 == 0
#!/usr/bin/env ruby
# check for whitespace errors
git_ws_check = `git diff-index --check --cached HEAD --`
unless $?.success?
puts git_ws_check
exit 1
end
COOKBOOK_PATH = File.split `git rev-parse --show-toplevel`
@douglasjarquin
douglasjarquin / mongos.init
Created June 12, 2013 23:00
A mongos init script for Amazon Linux
#!/bin/bash
# mongos - Startup script for mongos
# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongos
# config: /etc/mongos.conf
# pidfile: /var/run/mongo/mongos.pid
@douglasjarquin
douglasjarquin / default.vcl
Created May 22, 2013 15:54
Default Varnish config on Amazon Linux
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "127.0.0.1";
.port = "80";
}