Skip to content

Instantly share code, notes, and snippets.

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@captn3m0
captn3m0 / index.mkd
Created June 18, 2012 05:59
Browsing the web without Javascript and Images

The only connection available to me right now is a limited 3g connection, which I try not to squander over huge images/media on the internet. My browser is chromium, on linux, and I tend to use Opera 11 (turbo mode) frequently as well.

Just as an experiment, I disabled images & javascript from my browser a few weeks back. What all have I got?

  • Faster pages (I use http://google.com/xhtml occasionally to search)
  • Broken websites (http://about.me/n3m0 which don't run on disabling javascript at all)
  • Broken navigation (http://parse.com due to images being used as links. And since chrome does not display <alt> tags properly, it breaks)
  • Reduced Functionality (Gmail refuses to load chat if images are disabled)

Other than the normal chrome content blocking, I also went ahead and installed ghostery addon. It blocks all advertising, and social media junk (no more sharing). However, it is only useful on the occasional sites I have enabled javascript on.

@willurd
willurd / web-servers.md
Last active July 19, 2024 02:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 18, 2024 20:50
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jeanlescure
jeanlescure / README.md
Last active July 11, 2024 08:29
Ubuntu/Debian Offline Repository Creation

Ubuntu/Debian Offline Repository Creation Gist

When I googled how to create my own offline repository of packages for use in an offline Ubuntu/Debian machine, the results were disheartening and the steps to be taken scattered all over the place.

The files within this gist will allow you to:

  • Download specific apt-get packages... with dependencies included!
  • Create a Packages.gz file so that you can add the repository folder you create to the target machine's /etc/apt/sources.list file.

Before using

@kkirsche
kkirsche / aes256-gcm.go
Last active February 23, 2024 14:56
AES-256 GCM Encryption Example in Golang
package example_test
import (
"crypto/aes"
"crypto/cipher"
"hex"
"io"
)
// AES-GCM should be used because the operation is an authenticated encryption
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active July 4, 2024 13:39
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff &gt; some-changes.patch
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"
@julienbourdeau
julienbourdeau / commit-message-convention.md
Created May 2, 2016 12:02
The seven rules of a great git commit message

Source: http://chris.beams.io/posts/git-commit/#seven-rules

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how