To play Tic Tac Toe ! with Cypher queries.
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
| navigator.camera.getPicture( | |
| function (imageData) { | |
| var request = new enyo.Ajax({ | |
| url: "http://my_server_address:5984/mobility_camera_test/", | |
| method: "POST", | |
| handleAs: "json", | |
| contentType: "application/json", | |
| postBody: '{"image": "' + imageData + '"}' | |
| }); | |
| request.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
| mynamespace = window.mynamespace || {}; | |
| mynamespace.Parent = function (param) { | |
| var _privateProperty = param; | |
| return { | |
| getTwice : function () { | |
| return _privateProperty * 2; | |
| } |
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
| package eu.pulsation.alarmsandbox | |
| import android.accounts.{AccountAuthenticatorActivity, AccountManager} | |
| import android.os.Bundle | |
| import android.app.Activity | |
| import android.widget.{Button, EditText} | |
| import android.view.View.OnClickListener | |
| import android.view.View | |
| import android.accounts.Account |
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
| { | |
| "_id": "replication_task", | |
| "source": "https://user:[email protected]:6984/source-database", | |
| "target": "target-database", | |
| "user_ctx": { | |
| "user": "admin", | |
| "roles": [ | |
| "_admin" | |
| ] | |
| }, |
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
| val myHashList = List("at work" -> 7, "at home" -> 5, "at david's" -> 3) | |
| val myNewValue = "at home" -> 1 | |
| myHashList :+ myNewValue groupBy (_._1) map {case (k, v) => (k, v.map(_._2).sum)} toList | |
| // List(at home -> 6, at work -> 7, at david's -> 3) |
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
| package rss | |
| import scala.xml._ | |
| class Feed(val url: String) { | |
| def downloadItems(): List[Item] = { | |
| val root = XML.load(url) | |
| (root \\ "item").map(buildItem(_)).toList | |
| } | |
| def buildItem(node: Node): Item = { |
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
| #!/usr/bin/env php | |
| <?php | |
| function wsse_header($username, $password) { | |
| $nonce = hash_hmac('sha512', uniqid(null, true), uniqid(), true); | |
| $created = new DateTime('now', new DateTimezone('UTC')); | |
| $created = $created->format(DateTime::ISO8601); | |
| $digest = sha1($nonce.$created.$password, true); | |
| return sprintf( |
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
| class App { | |
| public static class SuperClass {} | |
| public static class SubClass extends SuperClass {} | |
| public static <T, U extends T> U returnSub(T sup, U sub) { | |
| return sub; | |
| } | |
| public static void main(String[] args) { | |
| SuperClass parent = new SuperClass(); |
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
| #!/bin/sh | |
| # extend non-HiDPI external display on DP* above HiDPI internal display eDP* | |
| # see also https://wiki.archlinux.org/index.php/HiDPI | |
| # you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949 | |
| # https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319 | |
| EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1` | |
| INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1` | |
| ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'` |
OlderNewer
