Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / npm-node
Created June 23, 2015 09:11
node and npm tips
# Node version management
https://github.com/tj/n
# Switch between different .npmrc files
https://github.com/deoxxa/npmrc
@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
window.lpTag=window.lpTag||{};if(typeof window.lpTag._tagCount==='undefined'){window.lpTag={site:'qa8237232'||'',section:lpTag.section||'',autoStart:lpTag.autoStart===false?false:true,ovr:lpTag.ovr||{domain : 'tlv_plankton3',tagjs : 'tlv_plankton4'},_v:'1.5.1',_tagCount:1,protocol:location.protocol,events:{bind:function(app,ev,fn){lpTag.defer(function(){lpTag.events.bind(app,ev,fn);},0);},trigger:function(app,ev,json){lpTag.defer(function(){lpTag.events.trigger(app,ev,json);},1);}},defer:function(fn,fnType){if(fnType==0){this._defB=this._defB||[];this._defB.push(fn);}else if(fnType==1){this._defT=this._defT||[];this._defT.push(fn);}else{this._defL=this._defL||[];this._defL.push(fn);}},load:function(src,chr,id){var t=this;setTimeout(function(){t._load(src,chr,id);},0);},_load:function(src,chr,id){var url=src;if(!src){url=this.protocol+'//'+((this.ovr&&this.ovr.domain)?this.ovr.domain:'lptag.liveperson.net')+'/tag/tag.js?site='+this.site;}var s=document.createElement('script');s.setAttribute('charset',chr?chr:
@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 / osx
Last active August 29, 2015 14:04
# dump file
sudo sysdiagnose -f ~/Desktop/
# file attributes
# http://mabouali.wordpress.com/2012/05/03/attribute-in-mac-osx-and-files-being-in-use-showing-in-gray/
xattr filename
xattr -d com.apple.FinderInfo filename
# mount ntfs drive as writable
# taken off a comment from post http://learnaholic.me/2013/11/11/enable-ntfs-write-on-mac-os-x-mavericks
@hamecoded
hamecoded / grunt-contrib-watch
Last active August 29, 2015 14:02
The Secrets of the Full Stack Ninja Workshop - Part A - The Client Side
# how to kill a locked livereload port
➜ myBlog git:(master) ✗ grunt
Running "watch" task
Waiting...
Fatal error: Port 35729 is already in use by another process.
➜ myBlog git:(master) ✗ lsof -i tcp:35729
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google 308 odeds 209u IPv4 0xa02f8facf3fa33fd 0t0 TCP localhost:50291->localhost:35729 (ESTABLISHED)
node 27569 odeds 12u IPv4 0xa02f8facdaf1f3fd 0t0 TCP *:35729 (LISTEN)
node 27569 odeds 15u IPv4 0xa02f8facdaf24be5 0t0 TCP localhost:35729->localhost:50289 (CLOSE_WAIT)