Skip to content

Instantly share code, notes, and snippets.

@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 / index.html
Created May 4, 2012 07:03
Sliding Clipboard
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:700italic,400,300,700' rel='stylesheet' type='text/css'>
<div class="holder">
@phongjalvn
phongjalvn / index.html
Created May 4, 2012 06:18
jQuery + Bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
@phongjalvn
phongjalvn / index.html
Created May 4, 2012 06:13
jQuery + jQuery UI
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><!-- Title here --></title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css">
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script src="script.js"></script>
@phongjalvn
phongjalvn / index.html
Created May 4, 2012 06:11
Basic template + jQuery
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
@phongjalvn
phongjalvn / index.html
Created May 4, 2012 06:01
Basic template
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<h1>Basic template!</h1>
@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