Skip to content

Instantly share code, notes, and snippets.

@interface Base58Encoder : NSObject {
}
+ (NSString *)base58EncodedValue:(long long)num;
@end
// 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]));
# 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
/*
* 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.
// [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",
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);
<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);
# 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" = "joern.zaefferer@googlemail.com" ];
then
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com";
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com";
git commit-tree "$@";
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
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,