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
;; Wrapping facebook4j in Clojure | |
;; Please include org.facebook4j/facebook4j-core "2.1.0"] | |
;; in your project.clj | |
(ns com.ykode.social.fb ;; change the namespace as you wish | |
(:import [facebook4j Facebook FacebookException FacebookFactory] | |
[facebook4j.auth AccessToken])) | |
(defn- kw->perms | |
"Converting keyword array such as [:public_profile :email] |
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
;; Depends on | |
;; [org.kohsuke.github-api "1.56"] | |
;; [clj-time "0.8.0"] | |
;; Samples converting kohsuke's GH* objects to clojure map | |
;; may inefficient but it works | |
(ns com.ykode.social.github | |
(:import [org.kohsuke.github GitHub GHMyself GHUser GHRepository] | |
[java.net URL]) | |
(:require [clj-time.format :as tf] |
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
;; Depends on clj-http and cheshire | |
(ns com.ykode.social.fb-lite | |
(:require [clj-http.client :as client] | |
[cheshire.core :refer [parse-string]])) | |
(defn- fburl [ext] (str "https://graph.facebook.com/" ext)) | |
(defn- auth-get | |
[access-token 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
import scala.collection.mutable.ListBuffer | |
import akka.actor.{Actor,ActorRef} | |
import akka.actor.Actor._ | |
import akka.routing.{ Listeners, Listen } | |
//Represents a domain event | |
trait Event | |
//A builder to create domain entities | |
trait EntityBuilder[Entity] { |
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
var idler = uv_idle_t() | |
uv_idle_init(uv_default_loop(), &idler) | |
uv_idle_start(&idler, { (_:UnsafeMutablePointer<uv_idle_t>) -> Void in print("Yay")}) | |
print("Idling...") | |
uv_run(uv_default_loop(), UV_RUN_DEFAULT) | |
uv_loop_close(uv_default_loop()) |
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
xcrun -v swiftc -emit-module -emit-library src/whiff.swift \ | |
-sdk $(xcrun --show-sdk-path --sdk macosx) -module-name Haste \ | |
-I deps/include -L deps/lib -luv -v \ | |
-Xlinker -unexported_symbols_list -Xlinker symbols.exp -Xcc -O3 -Xcc -g0 -Xlinker -x |
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
buildscript { | |
ext.kotlin_version = "1.0.0-beta-1103" | |
repositories { | |
jcenter() | |
mavenCentral() | |
maven { | |
url 'http://oss.sonatype.org/content/repositories/snapshots' | |
} | |
} | |
dependencies { |
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
.code16 # 16-bit Assembly (real mode) | |
.text # Mulai section text | |
.set MAGIC, 0xAA55 # Macro untuk MAGIC number boot record | |
.globl BootEntry # Simbol Entry Point | |
BootEntry: | |
cli # Matikan interrupt | |
xorw %ax, %ax # AX = 0 | |
movw %ax, %ds # DS = AX = 0 |
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
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
final class InstanceFactory <T> { | |
public T unsafeAllocate(final Class<?> clazz) { | |
final Class<?> unsafeClass = Class.forName("sun.misc.Unsafe"); | |
final Field f = unsafeClass.getDeclaredField("theUnsafe"); | |
f.setAccessible(true); | |
final Object unsafe = f.get(null); | |
final Method allocateInstance = unsafeClass.getMethod("allocateInstance", Class.class); |
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
\begin{tikzpicture} | |
\matrix (m) [matrix of math nodes,row sep=3em,column sep=8em,minimum width=2em] | |
{ | |
& \bullet \\ | |
\bullet & \bullet \\ | |
& \bullet \\}; | |
\path[->] (m-2-1) edge [in=70,out=100,loop] node[auto](F) {$f$} (); | |
\path[->,draw] (m-2-1) edge [in=60,out=120,loop,distance=2cm] node[auto](G) {$g$} (m-2-1); | |
\path[->,draw] (m-2-1) to [in=40,out=140,loop,distance=4.5cm] node[auto](GCF) {$g\circ f$} (m-2-1); |