Skip to content

Instantly share code, notes, and snippets.

View bithavoc's full-sized avatar

Johan Hernandez bithavoc

View GitHub Profile
typedef NS_ENUM(NSInteger, UITableViewCellStyle) {
UITableViewCellStyleDefault, // Simple cell with text label and optional image view (behavior of UITableViewCell in iPhoneOS 2.x)
UITableViewCellStyleValue1, // Left aligned label on left and right aligned label on right with blue text (Used in Settings)
UITableViewCellStyleValue2, // Right aligned label on left with blue text and left aligned label on right (Used in Phone/Contacts)
UITableViewCellStyleSubtitle // Left aligned label on top and left aligned label on bottom with gray text (Used in iPod).
}; // available in iPhone OS 3.0
@bithavoc
bithavoc / add_multilang_hstore_gem_to_gemfile.sh
Last active December 12, 2019 06:41
Using multilang-hstore in Rails 4
# add the gem to your Gemfile
gem 'multilang-hstore', '~> 1.0.0'
# execute bundle install
Printing description of response->_references:
{
"classes/message" = {
data = {
desc = "An amazing Chat Message.";
name = message;
};
deleted = 0;
name = message;
ref = "classes/message";
@bithavoc
bithavoc / command definition.js
Last active December 10, 2015 23:30
Command with Fauna Sub Requests
// POST /commands result
{
"resource" : {
"ref" : "commands/reply_message",
"ts" : 1357900098422864,
"name" : "reply_message",
"comment" : "Reply a Message",
"actions" : [ {
"method" : "POST",
"path" : "/v0/instances",
@bithavoc
bithavoc / command.sh
Last active December 10, 2015 23:08
Creating and Executing Fauna Commands
echo "Updating Command Definition"
curl https://rest.fauna.org/v0/commands/reply_message -X PUT -u AQAAS6hRHMAAAABB9FVmsAAAXH9CRKgC6N801bp80lKB1g: -d '{ "comment": "Reply a Message", "actions":[{"method":"POST", "path":"/v0/instances", "body":{ "class":"message", "data":{ "body":"$body" } } }]}'
echo "Invoking Command (now using a user Token)"
curl https://rest.fauna.org/v0/commands/reply_message -X POST -u AQIAT9qymjAAAABJd3D_AAAAAEH0VWawAAABAEbK2k9gAABuUBqDLSjdEsmvUUWrxE_zAAAAAAAAAA: -d '{ "body": "My message" }'
@bithavoc
bithavoc / file.md
Created November 24, 2012 18:13 — forked from guilleiguaran/file.md
Why Google V8 is not suited for integration into servers

Why Google V8 is not suited for integration into servers

06/09/2010

Last time I studied the ability to embed javascript in nginx using the library Google V8 Javascript Engine , it should be noted, was no easy task, as all that complicated the classic "Hello World!", reflected in the documentation is extremely sketchy. Because V8 developed primarily for Chrome, then this left a significant imprint on him and, to paraphrase Henry Ford's statement about the color of the machine, it can be said that the V8 will work well in any application, provided that this program is called Chrome.

First of all, V8 does not know how to handle memory allocation errors - it just ends the process. This is acceptable for such a browser like Chrome, which displays each page in a separate process, and the crash of one process does not affect the other pages, but for the server to process in one process thousands of simultaneous connections, it does not fit. While V8 allows you to set your own error handler memory allocation, howe

{
"process": {
"pid": 30482,
"uid": 501,
"gid": 20,
"cwd": "/Users/thepumpkin/Projects/testCarapace",
"execPath": "/usr/local/bin/node",
"version": "v0.6.18",
"argv": [
"node",
DEBUG: Error: Hello Error
at Object.<anonymous> (/Users/thepumpkin/Projects/testCarapace/app.js:38:7)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:38)
@bithavoc
bithavoc / hello.d
Created March 30, 2012 19:26
ThePumpkinLearningD
#!/usr/bin/rdmd
import std.stdio;
void main() {
writeln("Hello World!");
}
{
"name": "firebase",
"version": "0.0.1-27",
"scripts": {
"start": "node app.js"
},
"domains": [
"firebase.co"
],
"subdomain": "firebase",