Skip to content

Instantly share code, notes, and snippets.

View azizshamim's full-sized avatar
:octocat:
talkin' bout GitHub

Aziz Shamim azizshamim

:octocat:
talkin' bout GitHub
  • GitHub Staff
  • Nashville, TN
View GitHub Profile
@azizshamim
azizshamim / arrays_with_keys.js
Last active December 10, 2015 00:19
Javascript funniness
> var foo = []
undefined
> foo
[]
> foo['bar'] = 'baz'
'baz'
> foo
[ bar: 'baz' ]
>
@azizshamim
azizshamim / git_stats.sh
Created January 3, 2013 15:47
git stats
# Git commits per author
git shortlog -s -n
# Git commits per day
git log --date=short --format='%ad' | sort | uniq -c
1.8.7 :001 > h = {:foo_1=>"bar_1", :foo_2=>"bar_2"}
=> {:foo_1=>"bar_1", :foo_2=>"bar_2"}
1.8.7 :002 > j = {:foo_2=>"bar_2", :foo_1=>"bar_1"}
=> {:foo_1=>"bar_1", :foo_2=>"bar_2"}
1.8.7 :003 > h == j
=> true
1.8.7 :004 > h.to_s == j.to_s
=> true
@azizshamim
azizshamim / gist:4747272
Created February 9, 2013 21:50
star_wars_traceroute
$ traceroute 216.81.59.173
traceroute to 216.81.59.173 (216.81.59.173), 64 hops max, 52 byte packets
1 x (x) 2.220 ms 5.080 ms 1.965 ms
2 x 31.940 ms 45.329 ms 25.257 ms
3 x 12.538 ms 13.050 ms 11.563 ms
4 x 14.415 ms 18.927 ms 14.379 ms
5 x 19.753 ms
x 21.811 ms 28.600 ms
6 x 22.215 ms 21.264 ms 20.092 ms
7 x 19.144 ms 22.914 ms 22.615 ms
@azizshamim
azizshamim / gist:4946001
Created February 13, 2013 16:48
Node definition in deprecated environment
# Change my branch
node /*/ {
class { 'puppet':
agent => 'true',
environment => 'production',
puppetmaster => 'puppetmaster.wherever.com',
}
}
@azizshamim
azizshamim / addition_or_concatenation.js
Created February 20, 2013 16:56
Reasons I hate javascript
> "1.0" + 1.0
'1.01'
> "1.0" + "1.0"
'1.01.0'
> "1.0" + 2
'1.02'
> 2 + "1.0"
'21.0'
> 2 + 2
4
@azizshamim
azizshamim / footnotes.md
Last active December 14, 2015 10:09
awesome markdown

a link to something

[a link to something](http://www.google.com)

a link to something

[a link to something][google]
[google]\: http://www.google.com # without the backslash - kept parsing despite the triple-backtick
@azizshamim
azizshamim / rackspace_backup.sh
Created March 11, 2013 17:36
backup mysql database to rackspace cloudfiles
#!/usr/bin/env bash
BACKUP_DIR=/opt/database/backups/
MYSQL_USER=root
DATE=`date +%s`
API_KEY='xxxxxx'
API_USER='xxxxxx'
BUCKET='mysql_backups'
HOSTNAME=`hostname`
@azizshamim
azizshamim / puppet provisioner errors.ps1
Last active December 14, 2015 20:38
awesome vagrant errors with windows 7
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">Resolve-Path : Cannot find path 'C:\tmp\vagrant-puppet\manifests' because it do_x000D__x000A_</S><S S="Error">es not exist._x000D__x000A_</S><S S="Error">At line:7 char:15_x000D__x000A_</S><S S="Error">+ Resolve-Path &lt;&lt;&lt;&lt; $path| Out-Null;_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (C:\tmp\vagrant-puppet\manifests _x000D__x000A_</S><S S="Error"> :String) [Resolve-Path], ItemNotFoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Resol _x000D__x000A_</S><S S="Error"> vePathCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">Resolve-Path : Cannot find path 'C:\tmp\vagrant-puppet\modules-0' because it do_x000D__x000A_</S><S S="Error">es not exist._x000D__x000A_</S><S S="Error">At lin
@azizshamim
azizshamim / vagrant warnings
Last active December 15, 2015 04:58
vagrant fail
There were warnings and/or errors while loading your Vagrantfile.
Your Vagrantfile was written for an earlier version of Vagrant,
and while Vagrant does the best it can to remain backwards
compatible, there are some cases where things have changed
significantly enough to warrant a message. These messages are
shown below.
Warnings:
* `config.vm.customize` calls are VirtualBox-specific. If you're
using any other provider, you'll have to find provider-specific configuration