Skip to content

Instantly share code, notes, and snippets.

View DavidYKay's full-sized avatar

David Young-Chan Kay DavidYKay

View GitHub Profile
@bonkydog
bonkydog / user.clj
Last active August 29, 2015 14:14
Make stdout & stderr from all threads show up in cider repl
(alter-var-root #'*out* (constantly *out*))
(alter-var-root #'*err* (constantly *err*))
@raulraja
raulraja / gist:1176022
Created August 27, 2011 23:48
Async Operations with ObjectiveC Blocks
/*
* Copyright (C) 2011 47 Degrees, LLC
* http://47deg.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@kikofernandez
kikofernandez / detail.html
Last active December 16, 2015 11:49
we are going to show how to use and forge a friendship between the back-end and front-end. For the back-end, we are going to use Clojure (Compojure + Hiccup + Ring + Sandbar), and for the front-end, we are going to use AngularJS. We are going to use AngularJS for building small mini-applications that do something very specific, call it domain dr…
<label>Título: </label>
<input type="text" name="titulo" ng-model="question.title">
<label>Respuestas: </label>
<ul ng-repeat="answer in answers" ng-model="answers">
<li>{{answer.title}}</li>
</ul>
<input type="text" name="answer" ng-model="answer">
@steveriggins
steveriggins / gist:6652508
Last active December 23, 2015 14:59
iOS 7 has a bug (or made a design decision which goes against the documentation) to set the cookie policy of NSURLConnections to whatever the user has set their cookie preferences to via Settings -> Safari. This simple method resets the cookie policy to accept always. Apple documentation for cookieAcceptPolicy: https://developer.apple.com/librar…
- (void)takeControlOfTheCookies
{
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self takeControlOfTheCookies];
@leandrosilva
leandrosilva / ClientApp.java
Created June 7, 2012 07:01
My MessagePack-RPC sample: Clojure Server & Java Client
package msgpack.rpc.sample.client;
import org.msgpack.rpc.Client;
import org.msgpack.rpc.loop.EventLoop;
public class ClientApp {
private static class SpawnRequest {
private SpawnRequest(final int clientCount, final int requestCount, final RPCInterface iface) {
new Thread(new Runnable() {
public void run() {
@chirag04
chirag04 / Install.md
Last active March 29, 2019 03:49
compile rocksdb as backend for asyncstorage

Credits

All credit to @sahrens for sharing fb's internal implementation.

Setup

  • clone rocksdb from https://github.com/facebook/rocksdb.

  • edit MakeFile inside rocksdb. Search for Platform-specific compilation around line 1122. Make th next few lines to look like this:

ifeq ($(PLATFORM), IOS)
# For iOS, create universal object files to be used on both the simulator and
@bhauman
bhauman / README.md
Last active December 3, 2019 16:43
ClojureScript minimal dev and prod setup.

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.

@avescodes
avescodes / Editing Clojure with Emacs
Last active July 5, 2022 13:32
Get started editing Clojure in Emacs with this basic config.
Check out README.md to get started editing Clojure with Emacs.
@DavidYKay
DavidYKay / dualhead-xorg.conf
Last active August 2, 2022 18:25
X11 Config for dual / single screen NVIDIA TwinView.
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 280.13 (buildd@rothera) Fri Aug 5 12:28:41 UTC 2011
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
@alexpw
alexpw / gist:2166820
Created March 23, 2012 04:28
Clojure - macro try-catch
;; Approach 1, verbose
(defmacro try-catch [[lvl-fn fn] body]
(list 'try body
(list 'catch 'Exception 'e
(list lvl-fn 'e
(list ':name (list 'meta '#'fn))))))
(macroexpand '(try-catch [info foo] (reduce + 0 (range 5))))