Skip to content

Instantly share code, notes, and snippets.

View tonymtz's full-sized avatar
💻
Working From a Cafe

tonymtz tonymtz

💻
Working From a Cafe
View GitHub Profile
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
[
{
"keys": ["shift+f11"],
"command": "toggle_menu"
},
{
"keys": ["ctrl+f11"],
"command": "toggle_side_bar"
},
]
// Author: Jorge Garcia Miguel
// Script to get tp numbers from Target Process.
//
// INSTRUCTIONS:
//
// Copy and paste this script on web developer tools console and enjoy!.
(function () {
var storiesOrBugs = [],
tp = null;
@tonymtz
tonymtz / gist:714e73ccb79e21c4fc9c
Created November 15, 2014 00:02
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@tonymtz
tonymtz / uninstall_homebrew.sh
Created November 15, 2014 00:03
Uninstall Homebrew from OSX Yosemite
#!/bin/sh
function abort {
echo "$1"
exit 1
}
set -e
/usr/bin/which -s git || abort "brew install git first!"
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active December 29, 2023 00:40
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@tonymtz
tonymtz / install.sh
Created November 28, 2014 04:25
Installing GoLang
#!/usr/bin/env sh
# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/github.com/user
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
brew update && brew upgrade
brew install go
@tonymtz
tonymtz / git.sh
Created April 4, 2015 23:07
Git Configuration
git config --global user.name {USERID}
git config --global user.email {USERID@domain.tld}
git config --global branch.autosetuprebase always
git config --global push.default tracking
@tonymtz
tonymtz / MySingleton.cs
Created October 3, 2016 01:31
Singleton Unity C#
public class MySingleton : MonoBehaviour
{
private static MySingleton instance;
public static MySingleton Instance
{
get
{
if (instance == null)
{