Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Harshavardhana harshavardhana

I may be slow to respond.
View GitHub Profile
wrouesnel / Gulpfile.js
Last active Oct 19, 2016
webpack, react, golang self-contained gulpfile
View Gulpfile.js
var path = require('path');
var gulp = require('gulp');
var run = require('gulp-run');
var gutil = require('gulp-util');
var minimist = require('minimist');
var options = minimist(process.argv.slice(2), {
string: 'env',
jkeck / gist:3515705
Created Aug 29, 2012 — forked from MrDys/gist:3512455
Link directly to an open modal window in Bootstrap
View gist:3515705
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id and is classed with modal and permalink:
<div class="modal permalink" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
$(document).ready(function() {
un33k / sed cheatsheet
Created Aug 22, 2011
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
rponte /
Last active Jan 23, 2022
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
pixelhandler /
Last active Jan 24, 2022
Git pre-push hook to prevent force pushing master branch
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
# If this script exits with a non-zero status nothing will be pushed.
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
coolaj86 /
Last active Jan 24, 2022
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm config set "Your Name"
npm config set ""
npm config set "https:/"

npm config set init.version "1.0.0"
asukakenji /
Last active Jan 26, 2022
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box