Skip to content

Instantly share code, notes, and snippets.

View sethbergman's full-sized avatar
🐋
Building Docker Images for Dell Technologies

Seth Bergman sethbergman

🐋
Building Docker Images for Dell Technologies
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
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 https://www.npmjs.org/install.sh | sh
@jasonm23
jasonm23 / xterm-256color.svg
Last active February 11, 2024 12:33
Xterm 256color mode color chart, organised into sections. (used on Wikipedia/xterm)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jordanorelli
jordanorelli / fuck_time_warner.md
Last active June 3, 2019 14:14
Fuck you, Time Warner Cable

I missed a payment on my Time Warner Cable bill. Prior to this, the hostname of my laptop was "yupa" (after Master Yupa, from Nausicaa of the Valley of the Wind, because it's a MBA, get it, air? ok, sorry, that's fucking awful I know). Anyway, look at what my hostname is now:

jordanorelli@auto-prov[0] ~: hostname
auto-prov.rr.com

umm, excuse me, I never changed my hostname. Anyway, let's back the fuck up and see how I even discovered this.

When I got home today, I opened my MBA and fired up Chrome. On startup, it tried to open up all the tabs that were open when I closed it. Some of these included a google.com page. All of them were, instead, redirected to whatever hostname they were talking to, with ap_index tacked on the end. E.g., refreshing a Google page bounced me to google.com/ap_index, which is the automatic provisioning page that a Time Warner Cable tech is supposed to see when they start up the computer. My brother (who is also my roommate) opened the account and has all the i

@vsajip
vsajip / pyvenvex.py
Last active April 29, 2024 07:26
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages.The script needs Python 3.3 or later; invoke it using"python pyvenvex.py -h"fo…
#
# Copyright (C) 2013-2020 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
@reidransom
reidransom / crawl_site
Last active August 15, 2018 22:00
Download an entire website with wget
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
@ben-ng
ben-ng / parser.js
Created July 19, 2013 18:10
Heroku DB URL parser
function parse_url(str, component) {
// http://kevin.vanzonneveld.net
// + original by: Steven Levithan (http://blog.stevenlevithan.com)
// + reimplemented by: Brett Zamir (http://brett-zamir.me)
// + input by: Lorenzo Pisani
// + input by: Tony
// + improved by: Brett Zamir (http://brett-zamir.me)
// + improved by: Ben Ng (http://benng.me)
// % note: Based on http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js
// % note: blog post at http://blog.stevenlevithan.com/archives/parseuri
@cjolly
cjolly / README.md
Last active August 4, 2023 08:21
How to securely set rails secret key when you deploy to Heroku.

Stop Versioning Rails Secret Tokens

After reading Code Climate's Rails' Insecure Defaults I realized I was guilty of breaking rule 3. Versioned Secret Tokens. Here's how I fixed it.

Use dotenv in development and test environments:

# Gemfile
gem 'dotenv-rails', groups: [:development, :test]
@ktmud
ktmud / gulpfile.js
Last active February 28, 2022 10:39
An example gulpfile.js with bower components and live reload support
var BatchStream = require('batch-stream2')
var gulp = require('gulp')
var coffee = require('gulp-coffee')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-minify-css')
var bower = require('gulp-bower-files')
var stylus = require('gulp-stylus')
var livereload = require('gulp-livereload')
var include = require('gulp-include')
var concat = require('gulp-concat')
@vratiu
vratiu / .bash_aliases
Last active May 2, 2024 03:32
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset