Skip to content

Instantly share code, notes, and snippets.

@hamecoded
hamecoded / slideshow.js
Created October 31, 2012 10:15
Image Slideshow
<div id="slider1" class="slider">
<img src="http://www.schrankmonster.de/content/binary/astronomy_day.jpg"></img>
<img src="http://imagenes.publico.es/resources/archivos/2011/12/5/1323109544448planetadn.jpg"></img>
<img src="http://img.ehowcdn.com/article-new/ehow/images/a04/t9/al/astronomy-science-fair-ideas-800x800.jpg"></img>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="slideshow.js"></script>
<script>
@hamecoded
hamecoded / logrotate.conf
Created November 20, 2012 10:47
configuring logrotate
# /etc/logrotate.conf
# this is the logrotate main file, see: include /etc/logrotate.d
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
@hamecoded
hamecoded / app1.conf
Last active October 13, 2015 01:28
configuring nginx
#/etc/nginx/vhosts/app1.conf
upstream unicorn_app1 {
server unix:/home/user1/app1/shared/system/unicorn.sock;
}
server {
server_name domain.name.com, domain.name2.com;
# server_name _;
@hamecoded
hamecoded / log4j.properties
Created November 20, 2012 18:07
log4j properties
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.TTCCLayout
log4j.appender.stdout.layout.DateFormat=ISO8601
# File appender
log4j.appender.P=org.apache.log4j.DailyRollingFileAppender
log4j.appender.P.File=/var/log/app/app.log
#log4j.appender.P.MaxFileSize=10000KB
@hamecoded
hamecoded / HTML HAML BoilerPlate
Created December 13, 2012 16:38 — forked from am/index.haml
customized for mobile
# run ./buid_html from commandline
haml -f html5 index.haml > index.html
@hamecoded
hamecoded / chmod
Last active October 14, 2015 00:18
Associating SSH public key with hostcopy to clipboard the public key:cat name_dsa.pub | pbcopy
0 - no access to the file whatsoever
1 - execute permissions only
2 - write permissions only
3 - write and execute permissions
4 - read permissions only
5 - read and execute permissions
6 - read and write permissions
7 - read, write and execute permissions (full permissions)
Owner / UserGroupOther/ Everyone
@hamecoded
hamecoded / profileQuickSort.js
Last active December 14, 2015 03:29
QuickSort algorithm in JavaScript : Accompanies the YouTube video "Visual Demonstration of the QuickSort Algorithm" : http://www.youtube.com/watch?v=Z5nSXTnD1I4
/**
* Accompanies the video "Visual Demonstration of the QuickSort Algorithm"
* http://www.youtube.com/watch?v=Z5nSXTnD1I4
**/
function profileQuickSort(a){
var comparisons = 0;
var swaps = 0;
var func_calls = 0;
/**
@hamecoded
hamecoded / network
Created December 30, 2013 09:43
network commands
#on windows: show routing table
tracert -d google.com
#check if port 8000 inuse
sudo lsof -iTCP:8000 -sTCP:LISTEN
#on osx
traceroute -d 162.218.208.138
@hamecoded
hamecoded / vm
Last active January 2, 2016 00:29
virtualbox
# run on the guest(vm) to allow access permissions for the shared mac folder on ubuntu
#The sharename(fe) is the name chosen above.
#For example I've shared the Mac directory /Users/dherron/fe with the sharename of fe.
#The mountpoint(sf_fe/) is the directory within the guest system to mount this share
#- See more at: http://tutorials.davidherron.com/2008/06/virtualbox-running-ubuntu-accessing.html
#drwxrwx--- 1 root vboxsf 476 ינו 2 19:51 sf_fe
sudo mount -t vboxsf -o uid=1000,gid=1000 fe sf_fe/
#drwxr-xr-x 1 git git 476 ינו 2 19:51 sf_fe
@hamecoded
hamecoded / mongodb
Last active August 29, 2015 14:02
mongodb
## PART 1: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
# install
brew install mongodb
#create path
mkdir -p /data/db
#launch mongodb
mongod