Skip to content

Instantly share code, notes, and snippets.

View coldnew's full-sized avatar
💭
I may be slow to respond.

Yen-Chin,Lee coldnew

💭
I may be slow to respond.
View GitHub Profile
@coldnew
coldnew / gist:33e230eca3ec70b24cbe
Created January 8, 2016 11:27 — forked from dmatveev/gist:2295597
GFileMonitor sample application. Watches the specified path, registers events and prints it on the screen.
#include <glib.h>
#include <gio/gio.h>
#include <string.h>
static GMainLoop *gMainLoop = NULL;
char *
decode (GFileMonitorEvent ev)
{
char *fmt = g_malloc0 (1024);
@coldnew
coldnew / main.cpp
Last active January 5, 2016 10:09
Qt example for tarentella
#include <QApplication>
#include <QStringList>
#include <QListWidget>
#include <QRadioButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QListWidget *listWidget = new QListWidget();
(ns racehub.om.facebook
(:require [cljs.core.async :as a]
[racehub.schema :as rs]
[schema.core :as s :include-macros true]))
;; ## Utilities
(defn prune
"Takes a mapping of keys -> new key names and a map and returns a
map with nils removed and keys swapped where they're present in the
(in-ns 'clojure.core)
(defn dissoc-in [m keys]
(update-in m (butlast keys) dissoc (last keys)))
(defmacro defalias
"Defines an alias for a var, preserving metadata. Adapted from
clojure.contrib/def.clj, Ref. http://goo.gl/xpjeH"
([target] `(defalias ~(symbol (name target)) ~target nil))
([name target] `(defalias ~name ~target nil))
@coldnew
coldnew / auto-deploy.md
Created December 7, 2015 03:49 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@coldnew
coldnew / blog.html
Last active October 31, 2015 00:57
將 org-mode 輸出成 HTML 並具有按鈕可以切換顯示隱藏區域
<!-- 這份檔案是由 blog.org 產生出來 -->
<br><br> <div class="text-center">
<p class="btn btn-default" onclick="toggle_visible('p001')">
點我顯示/隱藏內容
</p>
</div><br><br>
<div id="p001" style="display:none">
<p>
這裡會被隱藏,直到點下 "點我顯示/隱藏內容"
(ns jsync.elevator
(:refer-clojure :exclude [map reduce into partition partition-by take merge])
(:require [clojure.core.async :refer :all :as async]))
;; This is necessary to check and see what is on the persistent queue
(defmethod print-method clojure.lang.PersistentQueue
[q, w]
(print-method '<- w)
(print-method (seq q) w)
(print-method '-< w))
@coldnew
coldnew / ClojureIntro.md
Created October 18, 2015 12:28 — forked from danmidwood/ClojureIntro.md
Evangelising Clojure at the Mind Candy Tech Forum

"Clojure Logo"

Let's REPL

In a terminal type: lein repl

; semi-colon marks the rest of the line as a comment
@coldnew
coldnew / simple_frame.scm
Created October 15, 2015 05:49 — forked from alcidesfp/simple_frame.scm
Ejemplo Swing Kawa
;; -*- coding:utf-8; mode:Scheme -*-
"Shows howto use Java Swing classes in Kawa Scheme"
(define-alias JLabel javax.swing.JLabel)
(define-alias JButton javax.swing.JButton)
;;========================================================================
(define-simple-class SimpleFrame (javax.swing.JFrame)
;; members
From dac3e3b75f117dede7aa577d48fc10efb5a53dd1 Mon Sep 17 00:00:00 2001
From: Erik Larsson <erik@ortogonal.com>
Date: Thu, 30 Oct 2014 10:49:03 +0100
Subject: [PATCH] Add fix to get QtWayland Compositor running on iMX6.
This patch is not really done yet, it's just some test.
Change-Id: If57be6d26b3d56a772db73d29cede6215f033a80
Signed-off-by: Erik Larsson <erik@ortogonal.com>
---