Skip to content

Instantly share code, notes, and snippets.

@ubergoober
ubergoober / rmAtom
Created September 4, 2015 07:06
OSX - Remove all of Atom IDE
#Gleemed from atom site: https://discuss.atom.io/t/how-to-completely-uninstall-atom-for-mac/9084/12
rm -rf ~/.atom
rm /usr/local/bin/atom
rm /usr/local/bin/apm
rm ~/Library/Preferences/com.github.atom.plist
rm -rf ~/Library/Application Support/com.github.atom.ShipIt
rm -rf ~/Library/Application Support/Atom/
@ubergoober
ubergoober / rmAndroid
Created September 4, 2015 07:04
OSX - Remove all of Android Studio and Android SDK
#Gleemed from stackoverflow: http://stackoverflow.com/questions/17625622/how-to-completely-uninstall-android-studio
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
#if you would like to delete all projects:
@ubergoober
ubergoober / 0_reuse_code.js
Last active August 29, 2015 14:23
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
@ubergoober
ubergoober / shia
Last active August 29, 2015 14:22
Shia Do It web embedding without Chrome extension.
// Shia Do-It motivational overlay
// Found @ https://github.com/etaheri/do-it-chrome-extension
// Forked here https://github.com/ubergoob/do-it-chrome-extension
// assets can be gotten from either.
// Edit path to the video and the selector to hook.
<div class="shia-do-it"><div class="container"><video width="960" height="540" name="media" src="http://HOST/PATH/output.webm" style="visibility: hidden;"><source type="video/webm"></video></div></div>
<script type="application/javascript">
$(document).ready(function() {
@ubergoober
ubergoober / InstalledNodeModules
Created June 3, 2015 18:35
Get current node modules and their versions that are installed.
#run command from root of node project after npm install has been run.
ls node_modules | xargs -I % grep \"_id\" node_modules/%/package.json
@ubergoober
ubergoober / nodeUpdateMac
Last active August 29, 2015 14:21
Simple nodejs updating on Mac
#clear you npm cache
sudo npm cache clean -f
#install "n" (this might take a while)
sudo npm install -g n
#upgrade to lastest version
sudo n stable
@ubergoober
ubergoober / imageReplace
Created April 16, 2015 12:44
Cleanly replace missing images in web page
/*
The below img error snippet will instantly hide any broken image placeholders
although it appears there's extra steps happening here (hidding and unhiding),
The reason is that the split second delay of reloading a new placeholder image
can cause the ugly missing image placeholder to flash if we don't hide it instantly on err.
*/
$("img").error(function () {
$(this).css({visibility:"hidden"});
$(this).attr({src:'/images/theme/no_logo_placeholder.png'});
@ubergoober
ubergoober / cors.js
Created January 16, 2015 18:39
Disable CORS on Express.js
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
@ubergoober
ubergoober / ExpressNodeCORS
Created December 30, 2014 11:32
Express Node Server CORS
var app = express();
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
next();
});
@ubergoober
ubergoober / full_path_finder.sh
Created November 11, 2014 08:40
Show full path in OS X finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES