Skip to content

Instantly share code, notes, and snippets.

@robo8080
robo8080 / FaceDetectTest2.py
Created September 3, 2016 12:29
FaceDetectTest2.py
# coding: utf-8
import photos
import console
from objc_util import *
CIFilter, CIImage, CIContext, CIDetector, CIVector = map(ObjCClass, ['CIFilter', 'CIImage', 'CIContext', 'CIDetector', 'CIVector'])
def take_photo(filename='.temp.jpg'):
img = photos.capture_image()
@chriseth
chriseth / 0 README.md
Last active November 6, 2022 19:55
Formal verification for re-entrant Solidity contracts

This gist shows how formal conditions of Solidity smart contracts can be automatically verified even in the presence of potential re-entrant calls from other contracts.

Solidity already supports formal verification of some contracts that do not make calls to other contracts. This of course excludes any contract that transfers Ether or tokens.

The Solidity contract below models a crude crowdfunding contract that can hold Ether and some person can withdraw Ether according to their shares. It is missing the actual access control, but the point that wants to be made

@ryoppy
ryoppy / git_branch_sort_by_update_time.sh
Last active August 29, 2015 13:55
ブランチを更新日時順に並べるワンライナー。git branch sort by update time.
for cid in $(git branch -av | grep -v "> origin" | awk '{print $2}'); do; git show --pretty="%ct@%cn@%s" $cid | head -1; done | sort | gawk -F "@" '{print strftime("%c", $1) " : " $2 " : " $3}'
#!/bin/bash
# 下記を参考にしつつ作成
# https://gist.github.com/matchy2/3956266
# https://gist.github.com/saiten/1185755
if [ $# -eq 1 ]; then
channel=$1
case $1 in
r1) playpath='NetRadio_R1_flash@63346' ;;
@youz
youz / markdown-mode.l
Created November 4, 2011 12:53
改変 markdown-mode for #xyzzy (色付け & メジャーモード化)
;; -*- mode:lisp; package:markdown-mode -*-
;; markdown.l ( http://www.geocities.jp/kiaswebsite/xyzzy/markdown.html )
;; Rev: 227 を元に改変
;;
;; License
;; =======
;;
;; Copyright (c) 2011 Yousuke Ushiki <[email protected]>
;; Copyright (c) 2005,2006 kia
@saiten
saiten / rec_radiko.sh
Last active December 2, 2021 05:57
簡易radiko録音ツール。要swftools
#!/bin/sh
playerurl=http://radiko.jp/apps/js/flash/myplayer-release.swf
cookiefile=./cookie.txt
playerfile=./player.swf
keyfile=./authkey.png
if [ $# -eq 1 ]; then
channel=$1
output=./$1.flv