Skip to content

Instantly share code, notes, and snippets.

View rexagod's full-sized avatar

Pranshu Srivastava rexagod

View GitHub Profile
@rexagod
rexagod / resig-class-implementation.js
Last active March 9, 2022 06:20
Simple JavaScript inheritance implemented using John Resig's Class
/* Simple JavaScript Inheritance
* By John Resig https://johnresig.com/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};
@rexagod
rexagod / resig-class-intro.js
Last active March 9, 2022 06:20
Intro to John Resig's Class inheritance in JavaScript
var Person = Class.extend({
init: function(isDancing){
this.dancing = isDancing;
},
dance: function(){
return this.dancing;
}
});
var Ninja = Person.extend({
@rexagod
rexagod / emoji.json
Last active March 9, 2022 06:20
PublicLab.Editor's reference collection of emojis
{
"+1": "👍",
"-1": "👎",
"smiley": "😃",
"laughing": "😆",
"confused": "😕",
"heart": "❤️",
"tada": "🎉",
"clap": "👏",
"sweat_smile": "😅",
@rexagod
rexagod / nvm.md
Created May 5, 2019 07:28
Node Version Manager

Node Version Manager

Note: refers to any version-like string nvm understands. This includes:

  • full or partial version numbers, starting with an optional "v" (0.10, v0.1.2, v1)
  • default (built-in) aliases: node, stable, unstable, iojs, system
  • custom aliases you define with nvm alias foo

Any options that produce colorized output should respect the --no-colors option.

Usage:

@rexagod
rexagod / matches
Created June 17, 2019 19:34
command output for `matcher matches`
[ { confidence: { c1: 63, c2: 187 },
x1: 359,
y1: 48,
x2: 65,
y2: 309,
population: 9 },
{ confidence: { c1: 124, c2: 169 },
x1: 260,
y1: 333,
x2: 546,
@rexagod
rexagod / corners
Created June 17, 2019 19:35
command output for `matcher corners`
[ { x: 37, y: 261 },
{ x: 482, y: 402 },
{ x: 84, y: 331 },
{ x: 38, y: 293 },
{ x: 39, y: 246 },
{ x: 36, y: 251 },
{ x: 604, y: 382 },
{ x: 78, y: 457 },
{ x: 572, y: 264 },
{ x: 337, y: 367 },
@rexagod
rexagod / help
Created June 17, 2019 19:36
command output for `help`
Commands:
help [command...] Provides help for a given command.
exit Exits application.
matcher <query>
!USAGE COMMANDS!
update: Updates matcher environment.
clear: Clears console, and exits.
matches: Outputs pairs of matched key-points.
@rexagod
rexagod / update
Created June 17, 2019 19:38
command output for `matcher update`
⏳ ⏳
You are all set!
Current version: 0.1.0
@rexagod
rexagod / cli-demo.sh
Last active June 17, 2019 20:32
Demo shell script for matcher-cli.
echo -e "\033[38m"
echo -e "\033[38m Hi there! 👋"
echo -e "\033[33m"
echo -e $"\033[34m This is a demo for the https://github.com/publiclab/matcher-cli repository,\n which in itself is a Node-based CLI utility for headlessely testing your matcher.js configurations."
echo -e "\033[34m"
echo -e "\033[34m All issues and doubts are welcome at https://github.com/publiclab/matcher-cli/issues"
echo -e "\033[32m"
echo -e "\033[36m Start typing the commands below to see their outputs! Try typing in 'help'"
echo -e "\033[32m"
while true
@rexagod
rexagod / cli-demo.sh
Last active June 23, 2019 02:28
`matcher-cli` demo (w/ static data)
echo -e $"\033[38m Hi there! 👋\n \033[34m This is a demo for the https://github.com/publiclab/matcher-cli repository,\n which in itself is a Node-based CLI utility for headlessely testing your matcher.js configurations.\n\033[34m All issues and doubts are welcome at https://github.com/publiclab/matcher-cli/issues"
while true
do
echo ""
read -p "matcher@demo ~> " argv
URL = ""
case $argv in
"matches")
URL = "https://gist.githubusercontent.com/rexagod/0b1e9dad6ba12bc93f1213f8a068686a/raw/9bbc2dba5400f55ebed40154f6f74ae4cfefaac5/matches"
;;