This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
beforeSend: function(xhrObj){ | |
xhrObj.setRequestHeader("Accept","application/json"); | |
xhrObj.setRequestHeader("Content-Type","application/json"); | |
}, | |
contentType: "application/json", | |
type: "POST", | |
url: "http://svel.to/links", | |
data: '{ "links" : "http://emanuelcarnevale.com" }', | |
processData: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["svel.to", "svel to", "svelto", "short"], | |
icon: 'http://mikamai.com/favicon-black.png', | |
description: "Shortens URLs with http://svel.to", | |
help: "Type svel.to followed by the URL you want to shorten", | |
author: "Emanuel Carnevale", | |
license: "GPL", | |
homepage: "http://emanuelcarnevale.com", | |
arguments: [{role: "object", | |
nountype: noun_type_url, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -i -H "Content-type: application/json" -H "Accept: application/json" -X POST -d '{"link"="http://docs.jquery.com/Utilities/jQuery.each"}' http://svel.to/links | |
HTTP/1.1 500 Internal Server Error | |
Date: Mon, 12 Oct 2009 14:00:27 GMT | |
Server: Apache/2.2.9 (Ubuntu) Phusion_Passenger/2.2.4 | |
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.4 | |
Status: 500 | |
Vary: Accept-Encoding | |
Connection: close | |
Transfer-Encoding: chunked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> Interface to jsFluidDB </title> | |
<script type="text/javascript" src="jquery-1.3.2.js"> | |
</script> | |
<script type="text/javascript" src="jsFluidDB.js"> | |
</script> | |
<script type="text/javascript"> | |
function handleResponse(data){ | |
alert(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rename an email address in all old commits. | |
# WARNING: Will change all your commit SHA1s. | |
# Based off of the script from here: | |
# http://coffee.geek.nz/how-change-author-git.html | |
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ]; | |
then | |
GIT_AUTHOR_EMAIL="[email protected]"; | |
GIT_COMMITTER_EMAIL="[email protected]"; | |
git commit-tree "$@"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://simple-note.appspot.com/api/login"]]; | |
[request setHTTPMethod:@"POST"]; | |
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-type"]; | |
NSString *email = @"email@gmail"; | |
NSString *pwd = @"password"; | |
NSString *body = [NSString stringWithFormat:@"email=%@&password=%@", | |
[email stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], | |
[pwd stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding] | |
]; | |
NSLog(@"body: %@",body); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [jQuery] Headers support for $.ajax | |
// RPC and REST systems recommend using the HTTP ACCEPT header here is how to use them with jQuery | |
$.ajax({ | |
beforeSend: function(xhrObj){ | |
xhrObj.setRequestHeader("Content-Type","application/json"); | |
xhrObj.setRequestHeader("Accept","application/json"); | |
} | |
type: "POST", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Fluidy-hood | |
* author: Emanuel Carnevale | |
* http://github.com/ecarnevale/fluidy-hood | |
* | |
* an underground interwho | |
* aiming at the awesomeness of Hoodwink.d by _why the Lucky Stiff | |
* | |
* version 0.00001 a.k.a. Proof of Concept | |
* PUT and POST on the go. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PRINT TO KINDLE in Mac OSX (for Kindle DX) | |
# | |
# HUH? | |
# - Kindle file depository: | |
# - drag any supported Kindle file to a local folder | |
# - file will be automatically transfered whenever Kindle is connected | |
# - "Print To Kindle" Print menu option (PDF): | |
# - when Kindle is connected it will print as PDF straight to the Kindle (from anywhere) | |
# - when Kindle is not connected, it will print to the local folder and is transfered as soon as Kindle is connected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This sqlite3_exec limits the database to 50 DB pages (about 1.5Kb each) | |
// Huge memory win on iPhone. | |
if(sqlite3_exec(myDatabsae, "PRAGMA CACHE_SIZE=50", NULL, NULL, NULL) != SQLITE_OK) | |
NSLog(@"Couldn't set cache size: %s", sqlite3_errmsg([self.database sql])); |