Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@phongjalvn
phongjalvn / socks24.py
Created November 24, 2012 19:00 — forked from azeroz/socks24.py
Scrape socks24
#!/usr/bin/env python
import sys, re
import argparse
from datetime import datetime
from urllib import urlopen
from BeautifulSoup import BeautifulSoup
def main(url):
@phongjalvn
phongjalvn / socksproxy.js
Created August 20, 2012 09:49 — forked from telamon/socksproxy.js
Socks5 proxy implementation in Node.JS
// http://www.ietf.org/rfc/rfc1928.txt
// Tested with: curl http://www.google.se/ --socks5 1080 --proxy-user foo:bar
var States = {
CONNECTED:0,
VERIFYING:1,
READY:2,
PROXY: 3
};
@phongjalvn
phongjalvn / dabblet.css
Created May 18, 2012 17:19 — forked from LeaVerou/dabblet.css
Text masking — The SVG way
/**
* Text masking — The SVG way
*/
svg {
width: 6em; height: 1.5em;
font: 900 500%/1.2 'Arial Black', sans-serif;
}
text { fill: url(#wood); }
@phongjalvn
phongjalvn / dabblet.css
Created May 18, 2012 17:17 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@phongjalvn
phongjalvn / gist:2667115
Created May 12, 2012 15:13 — forked from jcbozonier/gist:1240614
Creating an image proxy in Node.js/Expressjs
app.get('/proxied_image/:image_url', function(request_from_client, response_to_client){
sys.puts("Starting proxy");
var image_url = request_from_client.params.image_url;
var image_host_name = url.parse(image_url).hostname
var filename = url.parse(image_url).pathname.split("/").pop()
var http_client = http.createClient(80, image_host_name);
var image_get_request = http_client.request('GET', image_url, {"host": image_host_name});
image_get_request.addListener('response', function(proxy_response){
@phongjalvn
phongjalvn / edit.html
Created May 9, 2012 06:06 — forked from gabriel-dehan/edit.html
Meteor wysiwyg livedata
<template name="editor">
<div class="well {{#if editor_mode}}editor-show{{/if}}" id="editor">
<textarea id="editor-area" placeholder="Enter your text ...">{{get_file}}</textarea>
</div>
</template>
@phongjalvn
phongjalvn / container.html
Created May 9, 2012 06:06
How to implement a router in Meteor-0.3.2
/* It calls the content helper, and then load the Template matching the route :
for exemple, /user/list will load the template "user_list"
It's not optimum but it works
*/
<template name="container">
<div class="container">
{{#content}}
{{/content}}
</div>
</template>
@phongjalvn
phongjalvn / package.json
Created May 9, 2012 06:06
Basic npm package for Meteor
{
"name": "Meteor",
"version": "0.3.2",
"description": "A new way to build apps.",
"author": "Meteor Development Group",
"homepage": "http://www.meteor.com/",
"repository": {
"url": "https://github.com/meteor/meteor"
},
"dependencies": {
@phongjalvn
phongjalvn / gist:2216564
Created March 27, 2012 14:52 — forked from maccman/gist:1232164
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3