Skip to content

Instantly share code, notes, and snippets.

View Otann's full-sized avatar
centring an emoji inside a circle is indeed difficult

Anton Chebotaev Otann

centring an emoji inside a circle is indeed difficult
View GitHub Profile
@joe-pindell
joe-pindell / ExportThingsToTaskPaper.scpt
Created April 8, 2011 20:18
An Applescript to export from Things to TaskPaper
set thePath to (path to desktop as Unicode text) & "ThingsToDo.txt"
set thingsToDoFile to (open for access file thePath with write permission)
set eof of thingsToDoFile to 0
set cr to ASCII character 10
tell application "Things"
-- Export to-dos from Inbox
write "Inbox:" & return to thingsToDoFile as «class utf8»
repeat with td in to dos of list "Inbox"
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@eliasson
eliasson / digest.clj
Created October 20, 2011 19:16
Clojure md5 digest
(defn md5
"Generate a md5 checksum for the given string"
[token]
(let [hash-bytes
(doto (java.security.MessageDigest/getInstance "MD5")
(.reset)
(.update (.getBytes token)))]
(.toString
(new java.math.BigInteger 1 (.digest hash-bytes)) ; Positive and the size of the number
16))) ; Use base16 i.e. hex
@tankchintan
tankchintan / gist:1335220
Last active November 30, 2019 00:17
Procedure for installing and setting Sun JDK Java on Default Amazon Linux AMI
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-i586.rpm
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
# Install Java
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 27, 2024 16:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@railwaycat
railwaycat / Emacs_starter.pl
Last active March 12, 2023 01:26
Start Emacs.app from CLI
#!/usr/bin/perl
# Emacs starter for Emacs mac port
# Thanks to Aquamacs Project and David Reitter
my $args = "";
my $tmpfiles = "";
for my $f (@ARGV) {
@gre
gre / decodeBase64.scala
Created November 15, 2012 13:43
Easy way to decode a base64 in Scala
import org.apache.commons.codec.binary.Base64
val base64 = "data:([a-z]+);base64,(.*)".r
def decodeBase64 (src: String): Option[(String, Array[Byte])] = {
src match {
case base64(mimetype, data) => Some( (mimetype, Base64.decodeBase64(data.getBytes("utf-8"))) )
case _ => None
}
}
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@ragnard
ragnard / redis.clj
Last active February 20, 2021 16:27
Using Redis for persistent memoization of Clojure functions
(ns util.redis
(:refer-clojure :exclude [memoize])
(:require [taoensso.carmine :as car]))
;; boilerplate stuff that is not in Carmine
(def ^:dynamic ^:private *pool*)
(def ^:dynamic ^:private *spec*)
(defmacro with-redis
@eltimn
eltimn / MarkdownTypedField.scala
Last active December 15, 2015 16:59
A lift Record Field for storing and converting Markdown. Uses Actuarius - https://github.com/chenkelmann/actuarius
package code.model
import scala.xml._
import net.liftweb.util._
import net.liftweb.common._
import net.liftweb.http.S
import net.liftweb.record._
import net.liftweb.record.field._
import S._