Skip to content

Instantly share code, notes, and snippets.

View swape's full-sized avatar
😎

Alireza Balouch swape

😎
  • Mjolnir Media AS
  • Kongsberg, Norway
  • 12:00 (UTC +02:00)
View GitHub Profile
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active May 21, 2024 22:05
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@CrocoDillon
CrocoDillon / cookies.js
Last active February 11, 2024 22:42
Export your awesome module using AMD, CommonJS, Node.js or just as global.
/*
* Inspiration (well… copy pasting more or less) from:
* https://github.com/ScottHamper/Cookies/blob/0.3.1/src/cookies.js#L127-L140
*
* Thanks Scott!
*/
(function (global) {
'use strict';
var MyModule = function () {
@willurd
willurd / web-servers.md
Last active May 23, 2024 20:20
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
@peterc
peterc / wad.rb
Created January 25, 2010 17:45
watches files and runs a command when they change
#!/usr/bin/ruby
#
# wad - watch and run
# watches files and runs a command when they change
#
# usage: wad <files> <command>
#
# example:
# ./wad index.html stylesheets/*.sass "sass stylesheets/main.sass stylesheets/main.css; open -g http://127.0.0.1:8000/"