Skip to content

Instantly share code, notes, and snippets.

View musically-ut's full-sized avatar
🐙
🐢 🎣 🐠

Utkarsh Upadhyay musically-ut

🐙
🐢 🎣 🐠
View GitHub Profile
@dansimau
dansimau / README.md
Created July 13, 2012 10:39
Enable git-style colour output in regular diff on Mac OS X

Enable git-style colour output in regular diff

Mac OS X

  1. Install colordiff using Homebrew:

     brew install colordiff
    
  2. Add function to your ~/.bash_profile:

@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@musically-ut
musically-ut / list_creation_profiling.R
Created July 29, 2012 12:04
Four different ways of creating lists
f1 <- function (n) {
l <- list()
for(idx in 1:n) {
l <- append(l, idx)
}
return(l)
}
f2 <- function (n) {
l <- list()
@ibeex
ibeex / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred
@r4um
r4um / airtel-usage.rb
Created August 21, 2012 09:57
Display Airtel broadband usage.
#!/usr/bin/env ruby
# Display airtel broadband usage. Output format is
# airtel_id/quota GB/used GB/days_left
require 'rubygems'
require 'nokogiri'
require 'open-uri'
page = Nokogiri::HTML(open("http://122.160.230.125:8080/gbod/gb_on_demand.do", 'User-Agent' => 'curl/7.26.0', 'Accept' => "*/*"))
@shama
shama / a_simple.js
Created September 17, 2012 16:38
Grunt Events
/*
* A) Simple Watch Events
*/
module.exports = function(grunt) {
grunt.initConfig({
nodeunit: {
files: ['test/**/*.js'],
},
watch: {
test: {
@mbostock
mbostock / .block
Last active September 6, 2023 14:50
Sunburst Partition
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/d3-sunburst
@Saicheg
Saicheg / screenshare
Created December 7, 2012 07:46
Share screenshots on Ubuntu using Dropbox
#!/bin/bash
################
# Description:
# This script will take screenshot of your desktop
# or only active window ( running with -u param ),
# copy it to /Dropbox/Public/share/ with uniq name
# and save path to clipboard
#################
# Requirements:
# Dropbox
@mirontoli
mirontoli / lang.js
Last active November 3, 2023 15:15
Get Language name based on iso 639-1 code
/**
* @author Anatoly Mironov (mirontoli)
* http://sharepointkunskap.wordpress.com
* http://www.bool.se
*
* http://stackoverflow.com/questions/3605495/generate-a-list-of-localized-language-names-with-links-to-google-translate/14800384#14800384
* http://stackoverflow.com/questions/10997128/language-name-from-iso-639-1-code-in-javascript/14800499#14800499
*
* using Phil Teare's answer on stackoverflow
* http://stackoverflow.com/questions/3217492/list-of-language-codes-in-yaml-or-json/4900304#4900304
@cobyism
cobyism / gh-pages-deploy.md
Last active May 17, 2024 10:22
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).