Skip to content

Instantly share code, notes, and snippets.

View hamal's full-sized avatar
🐢

Francesco Corazza hamal

🐢
View GitHub Profile
<?php
function current_page_url() {
$url = 'http';
if ($_SERVER["HTTPS"] == "on")
$url .= "s";
$url .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
$url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
else
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Syntaxes/CoffeeScript.tmLanguage
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Preferences/CoffeeScript.tmPreferences

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@hamal
hamal / streamingImageInRestService.java
Created September 13, 2012 00:28 — forked from jsfeng/streamingImageInRestService.java
Streaming images in JAX-RS REST service.
@Produces("image/jpeg")
@Path("/images")
public class ImageRestServiceImpl {
@Path("{id}")
public StreamingOutput getImage(@PathParam("id") int id) {
BufferedImage image = generateImage(id); //generate image using
return new StreamingImageOutput(image);
}
}