Skip to content

Instantly share code, notes, and snippets.

View kosh04's full-sized avatar
🎧

KOBAYASHI Shigeru kosh04

🎧
View GitHub Profile
#!/usr/local/bin/sbcl --script
;;;; craps.lisp
;;;;
;;;; My submission to http://programmingpraxis.com/2011/11/04/craps/
;;;; Simulates games of Craps, outputs statistics; REQUIRES SBCL (*posix-argv*)
;;;; GRE, 11/4/11
(defun two-dice ()
"The sum of rolling two dice"
(+ (1+ (random 6)) (1+ (random 6))))
#include <stdio.h>
#include <stdlib.h>
#include "librtmp/rtmp.h"
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("usage : %s url ticket\n", argv[0]);
return 1;
}
@bowbow99
bowbow99 / framework.l
Created February 27, 2012 08:55
#xyzzy nanri-master から multiframe へ取り込んだ変更のテスト
;;; -*- mode: lisp; package: user -*-
#|
使い方(暫定):
1. どこかへ framework.l と nanri-master-change-tests.l をダウンロード
2. M-x load-file
load file: path/to/framework.l
3. M-x load-test-file
test file: path/to/nanri-master-change-tests.l
4. M-x change-tests
@esehara
esehara / gist:3160352
Created July 22, 2012 17:21
良い Commit Messageを書きましょう(翻訳)

by https://github.com/erlang/otp/wiki/Writing-good-commit-messages

良いコミットメッセージは、重要な役割が、少なくとも三つあります。

  • レビューするプロセスをスピードアップする。
  • 良いリリースノートを書く手助けになる。
  • 将来、Erlang/OTPのメンテナンスを手助けするため(もしかしたら君かも!)。それは五年後の未来において、なんでコードの中で特定の変更が加えられたのか、あるいは特定の機能が追加されたのか見つけるため、ということ。
@gurdiga
gurdiga / minify-js.sh
Created November 25, 2012 13:34
JS minifying script with curl and Closure Compiler REST API
#!/bin/sh
# Use like this:
#
# minify-js.sh < app.js > app.min.js
#
curl -s \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

# INSTRUCTIONS: save as ~/.gdbinit
# REVISION : 6.1
# CONTRIBUTORS: mammon_, elaine, pusillus, mong
# NOTES: 'help user' in gdb will list the commands/descriptions in this file
# 'context on' now enables auto-display of context screen
#
# CHANGELOG:
# Version 6.1
# fixed filename in step_to_call so it points to /dev/null
# changed location of logfiles from /tmp to ~
@rednaxelafx
rednaxelafx / chakra.reg
Created May 15, 2013 04:13
Running a simple microbenchmark on both 32-bit and 64-bit versions of JScript 5.8 and 9.0, on 64-bit Windodws 7
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\ProgID]
@="Chakra"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\ProgID]
@="Chakra"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Chakra]
@="JScript Language"
@crmccreary
crmccreary / AESCipher.py
Created May 20, 2013 02:17
Encryption using pycrypto, AES, and PKCS5 padding
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
class AESCipher:
def __init__( self, key ):
"""
@snmsts
snmsts / hello world
Created September 4, 2013 04:17
generate "Hello World" without including any literal.
(defmacro def-print-string (name string)
`(defun ,name ()
(let ((one (count t'(t))))
(print
(coerce
(mapcar #'code-char
(list
,@(loop :for i :across string
:collect
`(+ ,@(loop :for j := (char-code i) :then (floor j #.(count t'(t t)))