Skip to content

Instantly share code, notes, and snippets.

@eliellis
eliellis / regex.php
Created October 10, 2012 02:39
URL match
((https?:\/\/|ftp:\/\/)|www\.|ftp\.)([\w\.\-A-Z0-9+&@#\/%=~_|$?])+
@eliellis
eliellis / screener.js
Created December 31, 2012 01:49
Screen scraper for nodejs that uses cheerio and request
var request = require('request'),
http = require('http'),
url = require('url'),
async = require('async');
cheerio = require('cheerio');
function testElement(string){
var tester = new RegExp(string, 'g');
if(tester.test($(this).attr('class')) || tester.test($(this).attr('id'))){
return true;
@eliellis
eliellis / dabblet.css
Created January 13, 2013 06:21 — forked from lensco/dabblet.css
box-shadow vs filter: drop-shadow 2
/**
* box-shadow vs filter: drop-shadow 2
*/
body{
background: lightblue;
font: 16px sans-serif;
margin: 50px;
}
@eliellis
eliellis / C.sublime-build
Created May 26, 2013 18:41
Sublime build settings for .c files
{
"cmd": ["clang", "${file}", "-o", "${file_path}/${file_base_name}.o"],
"selector": "source.c",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "clang '${file}' -o '${file_path}/${file_base_name}.o' && '${file_path}/${file_base_name}.o'"]
}
]
### Keybase proof
I hereby claim:
* I am eliellis on github.
* I am ellis (https://keybase.io/ellis) on keybase.
* I have a public key whose fingerprint is A096 04FB 9CF9 B076 B8BA 1D94 6662 F1EA DB1E 62E0
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am eliellis on github.
  • I am ellis (https://keybase.io/ellis) on keybase.
  • I have a public key whose fingerprint is 9F33 74FB 7710 8267 B4C7 FE8D 1820 5725 CB67 4169

To claim this, I am signing this object:

@eliellis
eliellis / yarginator.ts
Last active February 4, 2022 02:51
Turn classes into yargs commands with Typescript decorators. WTFPL License.
import yargs, { Options } from "yargs";
import { hideBin } from "yargs/helpers";
const COMMAND_DEFINITION_METADATA = "__command:definition";
const COMMAND_PARAMETERS_METADATA = "__command:parameters";
export interface Constructor {
new (...args: any[]): {};
}