Skip to content

Instantly share code, notes, and snippets.

View nikhgupta's full-sized avatar
🏠
Working from home

Nikhil Gupta nikhgupta

🏠
Working from home
View GitHub Profile
@nikhgupta
nikhgupta / example.html
Last active January 4, 2016 03:19
FuelUX Form Wizard in AngularJS
<wizard class="form-horizontal" id="timeline">
<step title="Welcome">
<label for="title">Title (required):</label>
<input type="text" name="title" id="title" class="form-control"
required placeholder="Your Timeline Title" ng-model="currEL.title" />
<ul ng-show="$$prevSibling.step.title.$dirty && $$prevSibling.step.title.$invalid" class="ng-error-list">
<li ng-show="$$prevSibling.step.title.$error.required">An eventline, definitely, needs a title. Don't you think?</li>
</ul>
<!-- TODO: maybe use errors like this for every step -->
<!-- <errors> -->
# Benchmark for comparing `strings` vs `arrays` to hold large number of `string`
# values and lookups.
#
# Exercism.io - Robot Problem
require 'benchmark'
ITERATIONS = 15_000
# Rehearsal ------------------------------------------------
# string_robot 0.940000 0.000000 0.940000 ( 0.942041)
@nikhgupta
nikhgupta / custom.css
Created October 10, 2014 02:32
Custom CSS for MarkdownPreview plugin in Chrome
@import url(http://fonts.googleapis.com/css?family=Handlee|Open+Sans&subset=latin);
body {
font-family: "Open Sans", Helvetica, arial, sans-serif;
font-size: 1em;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
# RubyOnRails application template for building rapid prototyping of
# admin backends using ActiveAdmin, and other gem components.
#
# All the components (or features) added by this template are optional,
# and can be chosen (or removed) either by supplying relevant arguments
# on the command-line, or by answering the queries created by this
# template.
#
# This template is, highly, opinionated, and intentionally, kept as
# simple as possible, so that even the starters can just follow through,
@nikhgupta
nikhgupta / evil-shift-right-and-indent-region
Last active August 29, 2015 14:23
Mapping in Evil mode to indent a region and shift it right.
(defun evil-shift-right-and-indent()
(interactive)
(evil-indent (region-beginning) (region-end))
(evil-shift-right (region-beginning) (region-end)))
(define-key evil-visual-state-map ">" 'shift-right-and-indent)
@nikhgupta
nikhgupta / vim-bundler-debug.sh
Created August 17, 2015 10:11
Debug script for vim-bundler with mini vimrc
$ pwd
/tmp/bundle
$ ls -al .
total 4
drwxr-xr-x 3 nikhgupta wheel 102 Aug 17 15:03 ./
drwxrwxrwt 16 root wheel 544 Aug 17 14:55 ../
$ cat ~/Code/__dotfiles/minivimrc/vimrc
set nocompatible
(defcustom erc-ignore-content '()
"Regular expressions to identify content to ignore.
Usually what happens is that you add the bots to
`erc-ignore-list' and the bot commands to this list."
:group 'erc
:type '(repeat regexp))
@nikhgupta
nikhgupta / sample.html
Created October 22, 2016 15:09
Sample Files for Testing with Applications
<html>
<body>
<h1>Note</h1>
<p>Sent to <em>Tove</em> from <em>Jani</em> with heading <strong><em>Reminder</em></strong>
and body <strong>Don't forget me this weekend!</strong></p>
</body>
</html>
Verifying that "nikhgupta.id" is my Blockstack ID. https://onename.com/nikhgupta
#!/usr/bin/env bash
BASE_DOMAIN="${1:-localhost.dev}"
cd /usr/local/etc/httpd
# Days for the cert to live
DAYS=3650
# A blank passphrase
PASSPHRASE=""