Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Harshavardhana harshavardhana

💭
I may be slow to respond.
View GitHub Profile
@asukakenji
asukakenji / go-os-arch.md
Last active Oct 22, 2020
Go (Golang) GOOS and GOARCH
View go-os-arch.md

Go (Golang) GOOS and GOARCH

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

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • aix
  • android
@wrouesnel
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',
@rponte
rponte / get-latest-tag-on-git.sh
Last active Oct 12, 2020
Getting latest tag on git repository
View get-latest-tag-on-git.sh
# 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
pixelhandler / pre-push.sh
Last active Oct 6, 2020
Git pre-push hook to prevent force pushing master branch
View pre-push.sh
#!/bin/sh
# 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`
@jkeck
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() {
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active Oct 6, 2020
How to publish packages to NPM
View how-to-publish-to-npm.md

Getting Started with NPM (as a developer)

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

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser
@un33k
un33k / sed cheatsheet
Created Aug 22, 2011
magic of sed -- find and replace "text" in a string or a file
View sed cheatsheet
FILE SPACING:
# 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'
You can’t perform that action at this time.