Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Dayjob

Mark Sta Ana booyaa

🏠
Dayjob
View GitHub Profile
@booyaa
booyaa / xpath-queries.md
Last active December 11, 2015 20:28
Useful XPath queries
<root>
   <cd>
     <name>yes</name>
     <description>foo</description>
   </cd>
   <dvd>
     <name>shaun of the dead</name>
     <description>zomromcom</description>
@booyaa
booyaa / foo.js
Created February 13, 2013 11:01 — forked from anonymous/foo.js
// inspiration: https://github.com/damienklinnert/appdotnet
var request = require('request');
foo = function(cb) {
var opts = { uri: 'http://appd01:8111' };
request.get(opts, function(err ,resp, body) {
if (err) { return cb(err); }
return cb(null, resp, body);
@booyaa
booyaa / screencap.js
Created March 7, 2013 20:29
how to save a webpage (local file or one with a legit uri) in phantomjs (surprised this isn't in the example, may pr and see what happens)
/*jshint phantom: true, laxcomma: true*/
var system = require('system')
,page = require('webpage').create();
if (system.args.length === 1 || system.args.length < 3) {
console.log('Try to pass some args when invoking this script!');
phantom.exit();
}
var url = system.args[1];
@booyaa
booyaa / instapaper-bookmarklet.js
Created March 14, 2013 12:18
being nosy and peeking at marco's awesome instapaper bookmarklet
javascript : function iprl5() {
var d = document,
z = d.createElement('scr' + 'ipt'),
b = d.body,
l = d.location;
try {
if (!b)
throw(0);
d.title = '(Saving...) ' + d.title;
z.setAttribute('src', l.protocol + '//www.instapaper.com/j/QtAlSskhaIQL?u=' + encodeURIComponent(l.href) + '&t=' + (new Date().getTime()));
@booyaa
booyaa / notepadplusplustips.md
Last active December 15, 2015 03:38
notepad++ protips

####how to add quotes around numbers

before.txt

123
456
789
@booyaa
booyaa / nodejsgotchas.md
Last active December 15, 2015 09:09
node.js gotchas and pro tips

####package.json

if you're getting deprecation warnings, check the date of the blog post you're copying code from. chances are you're referencing old module versions.

###when deploying code

if you find you're getting oddness when deploying code to your awesome paas (nodejitsu, heroku, etc). one of your modules is probably reacting to NODE_ENV specifically when it's absent or set to production.

the easiest way to reproduce the oddness is to run the code locally this way:

@booyaa
booyaa / curlMagick.md
Last active December 15, 2015 12:48
curl magick

####how to ignore a duff certificate

curl -k https://cheaphosting.com

####how to HTTP POST json data and how to set headers

curl -H 'Content-Type: application/json' -X POST -d @stuff.json http://jsonapiserver.com

where @stuff.json is

@booyaa
booyaa / GenerateOracleDDL.md
Last active December 15, 2015 12:59 — forked from anonymous/CreateOracleTableCreation.md
Script schema creation for Oracle tables

if the table isn't local i.e. database link you'll need to create a local version to sniff

CREATE TABLE foo AS SELECT * FROM SCHEMA.TABLE@DBLINK.WORLD WHERE rownum < 11;

but surely this is enough? actually no, this will be a best guess by oracle.

if you need more control then the next bit of sql will allow you to tailor the schema create script without all the scripted guff that oracle likes to add.

	SELECT DECODE(A.COLUMN_ID,1,'CREATE TABLE '

|| A.TABLE_NAME

@booyaa
booyaa / vimagick.md
Created March 30, 2013 13:42
vim magick
@booyaa
booyaa / 3divlayout.md
Created April 1, 2013 15:25
3 div layout - wip

.testcontainer {¬ max-width: 384px;¬ /* top, right, bot, left */¬ padding: 0px 15px 0px 15px;¬ margin-left: auto;¬ margin-right: auto;¬ background-color: green;¬ height: 5px;¬ }¬ .tleftblock {¬