Skip to content

Instantly share code, notes, and snippets.

View peccu's full-sized avatar
🦉
Information is the network

peccu peccu

🦉
Information is the network
View GitHub Profile
@Songmu
Songmu / .slate.js
Last active December 14, 2015 15:39
S.on('appActivated', function (event, app) {
S.log('appActivated:' + app.name());
});
@siongui
siongui / draggable.js
Created February 17, 2013 00:40
AngularJS draggable element (position must be absolute)
/**
* @see https://github.com/siongui/palidictionary/blob/master/static/js/draggable.js
* @see http://docs.angularjs.org/guide/compiler
*/
angular.module('draggableModule', []).
directive('draggable', ['$document' , function($document) {
return {
restrict: 'A',
link: function(scope, elm, attrs) {
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 11, 2026 05:03
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@devlights
devlights / test.py
Last active August 10, 2022 03:00
Pythonでマルチバイト文字を扱う際に気をつける点。
# vim:fileencoding=utf-8
import codecs
import sys
import types
if __name__ == '__main__':
#
# ターミナルに出力する場合
# 以下のサンプルは、ターミナルに出力する場合は
# うまくいくが、リダイレクトさせてファイルに出力すると
@ttakezawa
ttakezawa / emacs-latest.spec
Created January 3, 2013 12:21
CentOS6.3でemacs 24.2のRPM作成に使ったSPECファイル
Name: emacs-latest
Version: 24.2
Release: 1%{?dist}
Summary: GNU Emacs
#Group:
License: GPL
URL: http://www.gnu.org/software/emacs/
Source0: http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@naoyat
naoyat / base⠼⠋⠙.py
Created December 13, 2012 19:24
use braille patterns for base64, instead of alphanumerics. joke.
#!/usr/bin/env python
#coding:utf-8
import sys
def base64_encode_(in_data, padding=False):
in_len = len(in_data)
out_data = []
for i in range(0, in_len, 3):
out_data.append(in_data[i] >> 2)
(defun logicless-template:emit (string)
(let ((tokens
(loop for x in (split-string string "{{")
nconc
(cond ((string-match "}}" x)
(let ((left (substring x 0 (match-beginning 0)))
(right (substring x (match-end 0))))
(list (format "%s" (eval (read left)))
right)))
(t (list x))))))
@m2ym
m2ym / clack+optima.lisp
Created November 25, 2012 16:15
Clack + Optima
(ql:quickload '(:clack :optima :optima.ppcre))
(defpackage :demo
(:use :cl :optima :optima.extra :optima.ppcre))
(in-package :demo)
(defun app (env)
(match env
((plist :request-method :get
:request-uri (or "/" (ppcre "^/(.+)$" name)))
@fukamachi
fukamachi / gist:4109258
Last active May 27, 2016 21:05
Pretty lambda/nil for Emacs
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama.
;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/
(defun set-pretty-patterns (patterns)
(loop for (glyph . pairs) in patterns do
(loop for (regexp . major-modes) in pairs do
(loop for major-mode in major-modes do
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode")))
(n (if (string-match "\\\\([^?]" regexp) 1 0)))
(font-lock-add-keywords major-mode
`((,regexp (0 (prog1 ()
@tarao
tarao / auth-command.sh
Created November 19, 2012 01:40
auth-command - a tool for SSH authorized commands
#!/bin/sh -e
base=`basename "$0"`
auth_options=',no-port-forwarding,no-agent-forwarding'
lf='
'
duser=`id -run`
dport=22
dconfig_dir_rel=".ssh/$base/config"