Skip to content

Instantly share code, notes, and snippets.

View polybuildr's full-sized avatar

Vivek Ghaisas polybuildr

View GitHub Profile

#Document Title

##Heading 2

###Introduction

Something, something. A link to Google.

  • Bullets
  • Another one
@polybuildr
polybuildr / node-dark-sol-fix.sh
Created September 23, 2014 20:32
Fix the 'invisible text' error while using node modules and dark solarized terminal theme
find . -type f -print0 | xargs -0 sed -i 's/colors.grey/colors.white/g'
find . -type f -print0 | xargs -0 sed -i 's/chalk.gray/chalk.white/g'
@polybuildr
polybuildr / randomstring.sh
Created October 17, 2014 19:03
Like, what? :P (P. S. Thanks to Coca Cola)
echo import random\;s=\"$(echo $(curl -s $(echo http://www.a`echo "import random; print ''.join(random.randint(2,60) * ['h'])" | python`.com) | base64) | tr -d " ")\"\; n = len\(s\)\;x=random.randint\(10, n-30\)\;print s[x:x+20] | python
@polybuildr
polybuildr / test-highlight.php
Last active February 22, 2020 19:39
Testing GitHub Gists syntax highlighting for PHP without an opening <?php tag.
$foo = "bar";
echo $foo;
<?php
$foo = "bar";
echo $foo;
@polybuildr
polybuildr / audio.js
Last active August 29, 2015 14:23
Create music using baudio and some custom code
var baudio = require('baudio')
, TAU = Math.PI * 2
var ADSR = function(a, d, s, r) {
this.attackDuration = a
this.decayDuration = d
this.sustainLevel = s
this.releaseDuration = r
var attackTime = false
@polybuildr
polybuildr / clipboard.sh
Created August 15, 2015 18:43
Command line script to copy to and from terminal command output
#!/bin/bash
# Linux version
# Use this script to pipe in/out of the clipboard
#
# Usage: someapp | clipboard # Pipe someapp's output into clipboard
# clipboard | someapp # Pipe clipboard's content into someapp
#
if command -v xclip 1>/dev/null; then
if [[ -p /dev/stdin ]] ; then
function color_my_prompt {
local __user_and_host="\[\033[01;m\]\u@\h"
local __cur_location="\[\033[01;34m\]\w"
local __git_branch_color="\[\033[01;31m\]"
#local __git_branch="\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt_tail="\[\033[00m\]$"
local __last_color="\[\033[00m\]"
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color "
}
#lang racket
(define IF
(lambda (test)
(lambda (then)
(lambda (else)
((test then) else)))))
(define true
(lambda (x)
num calls time self name
-----------------------------------------------------------------------------------
1) 1 6873.17 6873.17 88.36% 6822.90 6822.90 87.71% nvm_die_on_prefix
2) 1 7776.01 7776.01 99.96% 513.44 513.44 6.60% nvm_auto
3) 1 7262.58 7262.58 93.36% 275.00 275.00 3.54% nvm
4) 1 111.38 111.38 1.43% 97.92 97.92 1.26% nvm_ensure_version_installed
5) 3 53.54 17.85 0.69% 53.54 17.85 0.69% nvm_has
6) 1 13.46 13.46 0.17% 13.46 13.46 0.17% nvm_is_version_installed
7) 1 1.46 1.46 0.02% 1.46 1.46 0.02% nvm_supports_source_options
8) 2 0.46 0.23 0.01% 0.46 0.23 0.01% title