Skip to content

Instantly share code, notes, and snippets.

View zaach's full-sized avatar
🎯
Focusing

Zach Carter zaach

🎯
Focusing
View GitHub Profile
@zaach
zaach / list.js
Last active August 29, 2015 13:56
#!/usr/bin/env node
var json = require('./languages_all');
Object.keys(json).forEach(function(key) {
console.log(key);
});
### Keybase proof
I hereby claim:
* I am zaach on github.
* I am zii (https://keybase.io/zii) on keybase.
* I have a public key whose fingerprint is 25BD 0751 ACE8 7878 4D4E 7A2A 9CFB E9E8 B735 4118
To claim this, I am signing this object:
> fxa-oauth-server@0.0.0 start /Users/zcarter/moz/fxa-oauth-server
> grunt server --node-env=dev
Running "nodemon:dev" (nodemon) task
[nodemon] v1.0.17
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node bin/server.js`
{"level":40,"levelname":"INFO","hostname":"zachbook","name":"fxa.bin.server","pid":6975,"time":"2014-05-07T01:03:55.874Z","v":1,"msg":"Server started at: http://127.0.0.1:9010"}
diff --git a/lib/lookup.js b/lib/lookup.js
index c6e967d..7192e5e 100644
--- a/lib/lookup.js
+++ b/lib/lookup.js
@@ -19,7 +19,7 @@ const DEFAULT_PORTS = {
// like https.get() but transparently supports the
// $https_proxy and $no_proxy environment variables.
var getWithTransparentProxying = function(options, cb) {
- var httpmod = https;
+ var httpmod = http;
diff --git a/lib/lookup.js b/lib/lookup.js
index c6e967d..7192e5e 100644
--- a/lib/lookup.js
+++ b/lib/lookup.js
@@ -19,7 +19,7 @@ const DEFAULT_PORTS = {
// like https.get() but transparently supports the
// $https_proxy and $no_proxy environment variables.
var getWithTransparentProxying = function(options, cb) {
- var httpmod = https;
+ var httpmod = http;
zachbook ~/moz/fxa-content-server (update-convict)$ npm shrinkwrap
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/Users/zcarter/.nvm/v0.10.26/bin/npm" "shrinkwrap"
npm ERR! node v0.10.26
npm ERR! npm v2.1.3
npm ERR! Problems were encountered
npm ERR! Please correct and try again.
npm ERR! missing: ansi-regex@^0.2.0, required by has-ansi@0.1.0
npm ERR! missing: ansi-regex@^0.2.1, required by strip-ansi@0.3.0
import os
import cgi
form = cgi.FieldStorage()
callback = form.getvalue('callback','')
json = '{ip: "'+cgi.escape(os.environ["REMOTE_ADDR"])+'"}'
if callback != '':
print 'Content-Type: application/javascript'
<script>
// callback function
function getip(json){
alert(json.ip) // alerts the ip address
}
</script>
<script type="text/javascript" src="http://jsonip.appspot.com/?callback=getip"> </script>
#!/bin/bash
cd $1
gvim
cd -
// Ubiquity Google calculator script
// by Zach Carter http://zaa.ch
// MPL, MIT licensed 2008
(function(){
function scrapeResult(data) {
if(data.match(/<img src=\/images\/calc_img.gif width=40 height=30 alt="">/)){
return data.match(/<h2 class=r><font size=\+1><b>(.+)<\/b><\/h2>/)[1];
}else {