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

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
I am now able to insert test-image.png in other.md file using ![..](test-image.png) as opposed to ![..](static/otherpage/test-image.png)
content
├── pages
│   ├── otherpage
│   │   ├── test-image.png
│   │   └── other.md
│   └── project
│   ├── another-image.png
│   └── project.md
@coldnew
coldnew / sudoku.clj
Last active August 29, 2015 14:26 — forked from orb/sudoku.clj
updated for the latest core.logic, with some minor tweaks for (I hope) clarity
(ns sudoku
(:refer-clojure :exclude [==])
(:use [clojure.core.logic])
(:require [clojure.core.logic.fd :as fd]))
(defn init-board [vars puzzle]
(matche [vars puzzle]
([[] []]
succeed)
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>
---
@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
@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
(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 / 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>
這裡會被隱藏,直到點下 "點我顯示/隱藏內容"
@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.

(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))