Skip to content

Instantly share code, notes, and snippets.

@takumikinjo
takumikinjo / かんぺ.clj
Created June 18, 2011 06:34
ojagnaha0618
;;;;;;;;; かきかえのやつ
(import [android.widget TextView LinearLayout])
(. de.exterm.android.swank/handler
(post (fn []
(let [context de.exterm.android.swank/context
li (new LinearLayout context)]
(.setOrientation li LinearLayout/VERTICAL)
(let [tv (new TextView context)]
(.setText tv "Hello, AAA")
import bpy
mesh = bpy.context.active_object.data
uv_coord_list = []
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
bpy.ops.mesh.quads_convert_to_tris()
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
import bpy
mesh = bpy.context.active_object.data
uv_coord_list = []
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
bpy.ops.mesh.quads_convert_to_tris()
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
;; /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-shell-port=9999
;; telnet localhost 9999
;; ChromeDevToolsHandshake
;; Destination:
;; Tool:DevToolsService
;; Content-Length:66
;;
@takumikinjo
takumikinjo / lambda-and-proc.rb
Created February 29, 2012 15:15
lambda-and-proc
# -*- coding: utf-8 -*-
# lambda で Proc オブジェクトを作る
def foo(v)
f = lambda { |a, b|
puts "#{a}, #{b}, #{v}"
}
end
# Proc.new で Proc オブジェクトを作る
def bar(v)
@takumikinjo
takumikinjo / enake-camel.el
Created April 2, 2012 14:28
snake-case/camel-case elisp functions
;; Usage:
;;
;; (defun snake-camel () (interactive)(kill-new(upcase-first(snake-to-camel(car kill-ring)))))
;; (defun camel-snake () (interactive)(kill-new(upcase(camel-to-snake(car kill-ring)))))
(defun snake-to-camel (s)
""
(setq s (downcase s))
(if (string-match "_" s)
(concat (let ((fs (substring s 0 (match-beginning 0))))
@takumikinjo
takumikinjo / startup.sh
Created June 3, 2012 09:46
startup script for my rails app dev
#!/usr/bin/env bash
# tested on ubuntu12.04 server
# this cannot perform on lion. lion's ed command does not have 'y' command.
# rails new my-app
# cd my-app
# bash < <(curl -s https://raw.github.com/gist/2862788/ed729517cc94c3c3aee44bdbec1f3039184d5181/startup.sh)
git init
@takumikinjo
takumikinjo / README
Created September 29, 2012 12:27
Register users and memberships to Redmine
Register users and memberships to Redmine.
@takumikinjo
takumikinjo / .gitignore
Last active March 10, 2024 10:33
my favorite elisps
*.elc
@takumikinjo
takumikinjo / myrc
Created October 31, 2012 17:17
My favorite shell functions.
# . <(curl -L http://goo.gl/pdDKD)
# e.g.: jked /etc/hosts:3:
function jked {
file=`echo "$@" | sed 's/[:]/ /g' | awk '{print $1}'`
n=`echo "$@" | sed 's/[:]/ /g' | awk '{print $2}'`
if echo "$n" | grep '^[0-9]*$'; then
vi "$file" +"$n"
else
vi "$file"