Skip to content

Instantly share code, notes, and snippets.

@peteroid
peteroid / random-ua.sh
Last active August 30, 2017 15:23 — forked from kopiro/random-ua.sh
Random User agent in BASH
# On Mac, install `gsort` with `brew install coreutils`
UA=$(cat ua.txt | gsort -R | head -1)
@peteroid
peteroid / node-and-npm-in-30-seconds.sh
Last active January 23, 2017 16:27 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl -L https://www.npmjs.org/install.sh | sh
@peteroid
peteroid / error-report.js
Created January 6, 2017 10:01 — forked from tianjianchn/error-report.js
Error report util with fabric/crashlytics in react-native
/*global __DEV__*/
import StackTrace from 'stacktrace-js';
const Fabric = require('react-native-fabric');
const { Crashlytics } = Fabric;
//call this to start capturing any no-handled errors
exports.init = function(captrueOnDebugMode){
if (__DEV__ && !captrueOnDebugMode) {
return;