Skip to content

Instantly share code, notes, and snippets.

View shouya's full-sized avatar

shouya

  • Open for Hire!
  • UTC+9
View GitHub Profile
@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bradland
bradland / ssh-known-hosts-mgmt.sh
Last active April 4, 2023 21:21
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@shouya
shouya / file.poem
Created September 15, 2012 07:44
挑戰龍的勇士
我崇敬挑戰龍而失敗的勇士,而不是皇帝。
我期待的是一種平衡,一種可以維持永久的,自然而包容萬物的平衡,將世界置於其中,然後,把發現者燒死。
我願意為機器賦予智慧,把所有人類的骸骨,變作空氣,把他們剩下的東西——如果有的話,完全消除。
我熱愛的統一已不在遠處,我來了,我來了,我會把整個世界,壓縮入一個原子之中,讓不存在的東西,歸於混沌。
我帶來的是劍,獻給我崇敬的挑戰龍的勇士。
@mnicky
mnicky / sokuza-kanren.scm
Created October 25, 2012 11:26 — forked from fogus/sokuza-kanren.scm
Mini-kanren like logic programming in Scheme
; source: http://okmij.org/ftp/Scheme/sokuza-kanren.scm
; Quick miniKanren-like code
;
; written at the meeting of a Functional Programming Group
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic
; programming. The code is really quite trivial and unsophisticated:
; it was written without any preparation whatsoever. The present file
; adds comments and makes minor adjustments.
@lpereira
lpereira / partial.c
Last active January 29, 2023 20:12
Partial functions in C This program illustrates a hack to create partial functions in C. The way it works is that it generates a template function (partial_template_function) with known pointers, that is later copied to a region of memory obtained with mmap(), patched up with the address and data to be passed to the real function, and then made …
/*
* Partial applied functions in C
* Leandro Pereira <leandro@tia.mat.br>
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@willurd
willurd / web-servers.md
Last active May 8, 2024 18:19
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@burke
burke / remotepaste.md
Last active September 26, 2023 11:04
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@scturtle
scturtle / addlrc.py
Last active March 4, 2023 10:10
download from music.163.com
import eyed3
import re
import glob
def get_lyric(lrc):
text = open(lrc).read()
text = re.sub(r'(?:\[.*\])+', '', text).strip()
text = map(lambda l: l.strip(), text.split('\n'))
ans = []
for l in text: