Skip to content

Instantly share code, notes, and snippets.

View Wintus's full-sized avatar
📡
on the ground

wint Wintus

📡
on the ground
  • Tokyo
  • 12:12 (UTC +09:00)
  • X @wint7
View GitHub Profile
@Wintus
Wintus / TailRecursive.py
Last active August 29, 2015 14:02
A tail recursion optimizer by using decorator in Python
'''tail recursion decorator'''
from functools import wraps
class Continue(): pass
def tail_recursive(func):
first_call = True
CONTINUE = Continue()
args_kwd = None
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
my settings
@Wintus
Wintus / CodeIQ_Langs.md
Last active March 31, 2016 03:03
Available Languages in CodeIQ

Available Languages in CodeIQ

  1. Ada
  2. Assembler
  3. AWK (gawk)
  4. AWK (mawk)
  5. Bash
  6. bc
  7. Brainf**k
  8. C
@Wintus
Wintus / CodeIqHexDiff.txt
Created October 24, 2015 13:59
Debug 64bit int problem -- CodeIQ question solved in Haskell
Top (good answer): CodeIQ Haskell (ghc-7.8)
Bottom (wrong answer): paiza Haskell (ghc-7.6.2)
708010: count -> 2869584, index -> 2299
616490: count -> 120805, index -> 2082
count diff: 2748779, index diff: 217
143850: count -> 3160493, index -> 2583
945130: count -> 411714, index -> 2366
count diff: 2748779, index diff: 217
@Wintus
Wintus / AutoHotkey.ahk
Created February 7, 2016 23:31
AutoHotKeyRemappings
#NoEnv
; #InstallKeybdHook ; DEBUG: to get KeyHistory
; #SingleInstance ; auto-op with hot-keys
#+r::Reload
; Switch Suspension
^+f::Suspend,On
^+j::Suspend,Off
@Wintus
Wintus / 0_reuse_code.js
Created March 31, 2016 02:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Wintus
Wintus / Makefile
Created July 23, 2016 16:02
Make config file
Configs = $(wildcard conf.d/*.conf)
config: $(Configs)
echo '# ssh' | \
cat - $^ > $@
[ -e px ] && $(call SHPX, $@)
define SHPX
perl -p -i -e 's/^# sh\(.*\)/join "\n", px{$1}/e' $1
endef
@Wintus
Wintus / eigenclass.rb
Last active February 27, 2020 07:18
Ruby meta-programming
module Extended
refine Object do
alias_method :eigenclass, :singleton_class
# http://melborne.github.io/2012/07/12/object-repeat-take-care-of-sequence/
def repeat(init = true) # assume &block is given
x = self
Enumerator.new do |y|
y << x if init
loop { y << (x = yield x) }
@Wintus
Wintus / pg_table_size.sql
Created April 7, 2017 01:47
PostgreSQL Table Size Query
SELECT relname, reltuples, (relpages / 128) as mbytes, (relpages * 8192.0 / (reltuples + 1e-10)) as average_row_size FROM pg_class ORDER BY mbytes DESC;