Skip to content

Instantly share code, notes, and snippets.

@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 / mockProfile.json
Created June 2, 2016 12:03
msg_gw profile mocj
{
"firstName": "john",
"lastName": "Doe",
"avatarUrl": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpa1/v/t1.0-1/p160x160/12791106_1058614104197972_2327609442947442950_n.jpg?oh=54fcd49712f690f6bd0d990a003632df&oe=578D4A8A&__gda__=1468024968_48b87ceab0117877508b025971132e84"
}
@hamecoded
hamecoded / files.sh
Last active August 22, 2016 00:18
Dealing with files in the command line
#Image format conversion
brew install imagemagick
#bmp to jpg
mogrify -format jpg *.bmp
#http://www.imagemagick.org/script/mogrify.php
#file rename tool
brew install rename
#http://plasmasturm.org/code/rename/
@hamecoded
hamecoded / 0_reuse_code.js
Created December 4, 2016 12:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hamecoded
hamecoded / .zshrc
Last active January 31, 2018 16:05
java
# JAVA_HOME
#1.7.0_55-b13
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
# same as
#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home
#1.8.0_45-b14
# Apple installed java as seen in System Prefrences
#export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
@hamecoded
hamecoded / react-redux-500tech.sh
Last active February 11, 2018 13:59
react-redux
ps aux | grep node
kill -9 [pid]
npm install -g create-react-app
npm i styled-components --save
yarn add lodash
yarn add prop-types
yarn add react-router react-router-dom
@hamecoded
hamecoded / IntellijIdea
Last active February 15, 2018 11:31
application shortcuts cheatsheet and hacks
# https://medium.com/@jm90mm/adding-prettier-to-webstorm-a218eeec04d2
cmnd + shift + p :prettier
cmnd + option + l :formatter
cmnd + shift + i :quick definition on project tree. Then navigate with arrows