Skip to content

Instantly share code, notes, and snippets.

View vihanb's full-sized avatar
🐶
Probably at the doggo shelter

Vihan vihanb

🐶
Probably at the doggo shelter
View GitHub Profile
@vihanb
vihanb / chatbot.js
Last active March 4, 2016 03:25
respond with lmgtfy link
// Chatbot Plugin
function _toConsumableArray(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Talk=function(t){document.getElementById("input").value=t,document.getElementById("sayit-button").click()},Data=function(t,e){return t.replace(/\$([A-Za-z$_]+[A-Za-z$_0-9]*)/g,function(t,n){return e[n]})},Chatbot=function t(e,n,a){void 0===e&&(e="a Chatbot");var r=this,u=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=u.Startup,o=void 0===s?"Hi my name is $Name!":s,i=u.UID,l=void 0===i?0:i;_classCallCheck(this,t),this.Name=e,this.Options={Startup:Data(o,this),UID:l},this.onmessage=a||function(){return void 0},this.Queue=[];var c=Symbol("Called");this[c]=new Set,Talk(this.Options.Startup),setInterval(function(){[].concat(_toConsumableArray(document.getElementsByClassName("message"))).filter(function(t,e,n){return r[c].has(t)?!1:(r[c].a
@vihanb
vihanb / smallcaps.user.js
Created March 9, 2016 03:01
Make everything small caps
// ==UserScript==
// @name Small Caps
// @namespace asdfjeiwofsndalcxzafsd
// @version 1
// @description Make everything small caps
// @author Downgoat
// @match *://*/*
// @grant GM_addStyle
// ==/UserScript==
@vihanb
vihanb / README.md
Last active March 27, 2016 19:39 — forked from schas002/README.md
Expand VSL by forking the gist!

What To Do

Fork the gist, add your own expansion to expansions.txt, then ping @zyabin101 in the Nineteenth Byte chat. Stack Exchange profile required, obviously.

The Rules

  • Be meaningful. Three random words is not good enough.
  • Be funny. This is very subjective, we realize, so try not to take it personally if we don't get it.
  • Be novel. If your expansion starts with "Very" the other two words better be pretty great.
  • Avoid hyphenation.

Cheddar Grammar

Using WSN

Expression

Expression Definitions:

TypedLiteral = TOKEN ':' (PARENTHESIZED_EXPRESSION | PROPERTY | LITERAL)

| LITERAL .

@vihanb
vihanb / examples.cdr
Created June 13, 2016 04:43
Cheddar paradigms examples
//@F
IO.printf("Hello, %s!", IO.prompt("Name:", "Please enter your name"))
//@OO
class Greeter(String: name?) {
ask -> self.name = IO.prompt("Name:")
say -> IO.printf("Hello, #{self.name}!")
}
export main() {
const Hello := Greeter::()
@vihanb
vihanb / .bash_profile
Last active July 29, 2016 22:23
Dotfiles
export [email protected]
export EDITOR=nvim
export TERM=xterm-256color
export CLICOLOR=1
alias v=nvim
alias vi=nvim
alias vim=nvim
# MacPorts
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
@vihanb
vihanb / txt.out
Last active July 26, 2016 01:45
Gist description....
This file has been truncated, but you can view the full file.
8.000000072900000663390006036849054935326399911470239194379176668850\
50768653961994751054152234592785334794346546628553574319837526310521\
48942574555377428453934598930804850270324137459949650885541823058430\
58983171836746863714396459801007784189170836121454608705236939217656\
14688067093661410552318836026101407837522811321457583025264005529902\
45032211229793122191117411939168448646432882682539232411107014941073\
83596377190727032435615995164105555993360559539581091810187935472710\
21280166293649513272210570777116194071757366052992031082227482848270\
09391925785466524647745374294482906079794445326129452467778017456779\
95885669762559594839292313037560048641796442640347628027163415047187\
#!/usr/bin/env node
var cheddar = require('cheddar-lang');
var api = cheddar.stdlib;
// Enable Cheddar safe mode
global.SAFE_MODE = true;
// Print function
var printed = false;
set nocompatible
filetype off
execute pathogen#infect()
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'altercation/vim-colors-solarized'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.11759774386882782</real>