Skip to content

Instantly share code, notes, and snippets.

View hackervera's full-sized avatar
😻

Veronika Tyler hackervera

😻
View GitHub Profile
def higherOrder(proc_in)
return proc { |arg| arg + proc_in[5] }
end
foo = proc {|arg| arg + 1}
puts higherOrder(foo)[3] #=> 9
[Fri, 08 Oct 2010 22:10:08 GMT] [info] [<0.2200.538>] 10.220.226.191 - - 'PUT' /_config/vhosts/spora.pdxbrain.com 200
[Fri, 08 Oct 2010 22:10:08 GMT] [error] [<0.86.0>] {error_report,<0.31.0>,
{<0.86.0>,supervisor_report,
[{supervisor,{local,couch_secondary_services}},
{errorContext,child_terminated},
{reason,normal},
{offender,[{pid,<0.1488.538>},
{name,httpd},
{mfa,{couch_httpd,start_link,[]}},
{restart_type,permanent},
<<"function raised error: (new TypeError(\"result is undefined\", \"/home/tyler/couchdb-1.0.1/share/couchdb/server/main.js\", 925)) \nstacktrace: runUpdate(function (doc, req) {req.body = req.body.replace(/<.*?>/, \"\");var codez = new XML(req.body);var atom = new Namespace(\"http://www.w3.org/2005/Atom\");var poco = new Namespace(\"http://portablecontacts.net/spec/1.0\");var me = new Namespace(\"http://salmon-protocol.org/ns/magic-env\");var thr = new Namespace(\"http://purl.org/syndication/thread/1.0\");var profile = {nickname: codez..atom::author.atom::name.toString(), url: codez..poco::urls.poco::value.toString(), gravatar_url: codez..atom::logo.toString()};var hostname = codez..atom::author.atom::uri.toString().split(\"@\")[1];var message = codez..atom::content.toString();var created_at = new Date;if (profile.gravatar_url.length > 0) {return [{_id: req.uuid, created_at: created_at, xml: req.body, profile: profile, message: message, hostname: hostname, type: \"pubsub\"}, \"posted\"];}},[object Object],[ob
use "http://triplr.org/sparyql/sparql.xml" as sparql;
select * from search.web where query in ( select result.n.value from sparql where query=
"prefix foaf: <http://xmlns.com/foaf/0.1/>
SELECT distinct * WHERE { $a $c <http://dbpedia.org/ontology/HistoricPlace>.
$a foaf:name $n.
$a $f <http://dbpedia.org/resource/Portland%2C_Oregon>
} " and service="dbpedia.org/sparql")
@hackervera
hackervera / cookie.ttl
Created October 11, 2010 21:19
cookie ttl
function(doc, req){
var mustache = require('vendor/couchapp/lib/mustache');
var crypto = require('commonjs/crypto');
var date = new Date().getTime();
var pubkey = "-----BEGIN CERTIFICATE-----MIICsDCCAhmgAwIBAgIJAKmFgUCWaSzgMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMTAxMTA5MDk0MTE1WhcNMTAxMjA5MDk0MTE1WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBVhUggBKVuj4rl9hFgtxlBzFaOu3v3m11A3KzLKmPwien3bQy3dNRZpoPPzWvFEEZKLBhUlyuXGcfjFAI4ffD6ul405/yVmttKc9VZUD8aOMM1/b4CyfX+QiIMj54kNozEh1oR/CuqoeAgg9S/XLtqaGaPpVUhX+yWA3LVCmILQIDAQABo4GnMIGkMB0GA1UdDgQWBBSn0KDf/hEnx2ZclM54ET9yBl3+EDB1BgNVHSMEbjBsgBSn0KDf/hEnx2ZclM54ET9yBl3+EKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAKmFgUCWaSzgMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAE3/xH3uQvXMs/5T/DSH+datw3mF+hq9L+u3h50IXz2U0gJi0lB0LvwguhI6MRk/vKfqh5zHnD
require 'observer'
include Observable
class Controller
def temp(val)
changed
notify_observers(val)
end
end
var writer io.Writer
encoderRing := json.NewEncoder(writer)
encoderRing.Encode("foo")
fmt.Println(writer)
package main
import (
"crypto/aes"
"crypto/block"
"fmt"
"bytes"
"io"
)
func main(){
package main
import (
"crypto/aes"
"crypto/block"
"fmt"
"bytes"
"io"
)
func main(){