Skip to content

Instantly share code, notes, and snippets.

View gavinengel's full-sized avatar

Gavin Engel gavinengel

View GitHub Profile
@gavinengel
gavinengel / sudoless-npm.sh
Last active April 30, 2016 22:36
sudoless-npm.sh
#!/bin/sh
# Place npm packages in your home folder without using sudo
# The lazy approach to installing cli npm programs requires sudo (root) access:
# $ sudo npm install -g somenpmpackage
# Of course, I do not recommend installing npm packages with sudo unless it's required.
# This is how I install CLI tools from npm without sudo:
# $ lib
# $ npm install --save somenpmpackage
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links
@MikaelSoderstrom
MikaelSoderstrom / Nightmare-demo.js
Last active May 14, 2018 03:33
Testing with mocha, chai and nightmare.js
var path = require('path');
var Nightmare = require('nightmare');
var should = require('chai').should();
describe('Nightmare demo', function () {
this.timeout(15000); // Set timeout to 15 seconds, instead of the original 2 seconds
var url = 'http://localhost:3000';
describe('Start page', function () {
@janx
janx / centos-bitcoind-guide.markdown
Last active May 8, 2019 05:27
Install bitcoind on CentOS 6.5

##RPM Packages##

sudo yum install qt-devel protobuff-devel qrencode-devel

##Switch to user bitcoind##

sudo useradd bitcoind
sudo su - bitcoind
mkdir bitcoind

mkdir bitcoind/deps

@noteed
noteed / docker.md
Last active December 24, 2015 23:48
List of Docker things.

Docker things

  • quay.io (now acquired by CoreOS)
    • 5/10/20/50/125 private repositories for $12/$25/$50/$100/$200 (it was $7/$12/$22 for 5/10/20 repositories before) per month
    • unlimited public repositories
  • Reesd
    • 10GB/25GB/50GB for €20/€45/€80 per month
    • Illimited number of repositories/images/layers, only compressed layer space counts.
    • Disclaimer: it is a project of mine.
  • Now in beta :-)
@cerebrl
cerebrl / 1-securing-express.md
Last active August 2, 2023 22:48
Securing ExpressJS

tl;dr

  1. Don't run as root.
  2. For sessions, set httpOnly (and secure to true if running over SSL) when setting cookies.
  3. Use the Helmet for secure headers: https://github.com/evilpacket/helmet
  4. Enable csrf for preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf
  5. Don't use the deprecated bodyParser() and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use the defer property and pipe() the multipart upload stream to the intended destination.
@RIAEvangelist
RIAEvangelist / Install Cloud9 on local or remote computer, server, or raspberry pi
Last active June 6, 2023 03:37
This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git
@sayak-sarkar
sayak-sarkar / sublime-text-2.sh
Last active April 29, 2021 16:41 — forked from henriquemoody/sublime-text-2.sh
Gist updated to Sublime Text v2.0.2, 64bit
# Adapted from https://gist.github.com/henriquemoody/3288681
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/usr/local/sublime-text-2/sublime_text
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
@maxweisel
maxweisel / clickify.js
Created June 28, 2012 23:35
collect.js - use clean urls with Backbone History / Router
(function($){
// Declare the rootUrl used for filtering internal links.
var rootUrl = document.location.protocol + '//' + (document.location.hostname || document.location.host) + (document.location.port ? ':' + document.location.port : '') + '/';
// Helper functions
var getFragment = function(url, root) { // Grab the fragment and format it how Backbone expects
var fragment = url;
if (fragment.indexOf(':') !== -1)
fragment = fragment.replace(/.*:\/\/[^\/]+/, '');
if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
@khansensf
khansensf / MailHistory.bash
Created February 1, 2012 01:21
Email terminal history to self / evernote at logout. Great for search for obscure syntax you figured out sometime on some machine
#!/bin/bash
##################
# MailHistory.bash
# Ken Hansen 01/2010
#
# Calc history delta then email to self and evernote
#
# Called from ~/bash_logout
#