Skip to content

Instantly share code, notes, and snippets.

/**
* Ethereum Account Scanner
*
* To run this, you need your own geth node, accepting RPC
* connections on a port you can access.
*
* Install pre-requisites:
* sudo npm install -g web3
*
* Usage:
@thomaspeitz
thomaspeitz / Pokemon Go ZSH
Last active July 16, 2016 11:49
Is pokemon Go ready in my country? ZSH Theme + Script
Place Theme: ~/.oh-my-zsh/themes/nanotech.zsh-theme
Start Script in your first terminal tab with your country name
bash script.sh Germany
Add to ~/.zshrc
ZSH_THEME="nanotech"
@nownabe
nownabe / .commit_template
Created July 5, 2016 06:54
Emojiで楽しく綺麗なコミットを手に入れる
# ==== Emojis ====
# 🐛 :bug: バグ修正
# 👍 :+1: 機能改善
# ✨ :sparkles: 部分的な機能追加
# 🎉 :tada: 盛大に祝うべき大きな機能追加
# ♻️ :recycle: リファクタリング
# 🚿 :shower: 不要な機能・使われなくなった機能の削除
# 💚 :green_heart: テストやCIの修正・改善
@lifedever
lifedever / jquery.validate.ext.js
Created June 29, 2016 08:21
jQuery validate验证扩展
// 身份证号码验证
jQuery.validator.addMethod("isIdCardNo", function(value, element) {
// var idCard = /^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\w)$/;
return this.optional(element) || isIdCardNo(value);
}, "请输入正确的身份证号码");
// 手机号码验证
jQuery.validator.addMethod("isMobile", function(value, element) {
var length = value.length;
var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
@fseasy
fseasy / rotate.cpp
Created June 23, 2016 15:32
STL中的rotate算法!!牛逼
template <class ForwardIterator>
void rotateSTL(ForwardIterator first, ForwardIterator middle,
ForwardIterator last)
{
using std::swap;
ForwardIterator next = middle;
while(first != next)
{
swap(*first++, *next++);
if(next == last){ next = middle;}
@PragTob
PragTob / benchmark.rb
Created June 6, 2016 17:49
Ruby flat_map vs. map.flatten
require 'benchmark/ips'
Benchmark.ips do |bm|
list = (0..10_000).to_a
bm.report "flat_map" do
list.flat_map do |x|
[x, x * x]
end
end
@yin8086
yin8086 / aegisub_note_chinese.md
Created May 22, 2016 14:14
Aegisub32 Lua Script学习笔记(官方文档翻译总结)

Aegisub32 Lua Script学习

@(日常笔记)

一、整体结构

1. 全局变量——描述脚本元数据

  • script_name
  • script_description
  • script_author
  • script_version
@virtuald
virtuald / context_local.py
Last active June 18, 2020 08:10
Implements a threadlocal-like mechanism for Tornado
'''
This is significantly derived from StackContext, Apache 2.0 license
'''
from tornado.stack_context import StackContextInconsistentError, _state
class ContextLocal(object):
'''
Implements a threadlocal-like mechanism that can be used to track data
across tornado asynchronous calls. This is very similar to (and based
@nil2013
nil2013 / ClipboardTest.scala
Created April 11, 2016 16:58
How to use Clipboard in Scala
import java.awt.datatransfer.FlavorListener
import java.awt.datatransfer.FlavorEvent
import java.awt.Toolkit
import java.awt.datatransfer.DataFlavor
import scala.annotation.tailrec
object ClipboardTest {
private var listener: Option[StrFlavorListener] = None
def clipboard = Toolkit.getDefaultToolkit.getSystemClipboard
https://resourcepool.io/2014/08/21/java-quickies-hibernate-validator-reference-implementation-of-jsr-303/