Skip to content

Instantly share code, notes, and snippets.

Avatar
💤
procrastinating

Nattawut Phetmak neizod

💤
procrastinating
View GitHub Profile
@neizod
neizod / freq.html
Created Mar 29, 2014
[quick-dirty] html+js hack for cracking the substitution encryption.
View freq.html
<h3>encrypted sentence</h3>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<input name="text" size="40" />
<button id="mk">make</button>
<hr />
<h3>decrypted sentence</h3>
<div id="box"></div>
<hr />
@neizod
neizod / bubble.cpp
Last active Aug 29, 2015
Sorting Algorithms
View bubble.cpp
#include <iostream>
using namespace std;
int arr[] = {2,5,3,9,1,0,7,4,8,6};
void show(int i=-1) {
for (int k=0; k<10; k++) {
if (i-1 == k) cout << "\x1b[37;1m";
if (i == k) cout << "\x1b[31;1m";
cout << arr[k];
@neizod
neizod / kmeans.py
Last active Aug 29, 2015
k-means clustering.
View kmeans.py
#!/usr/bin/env python3
import sys
from itertools import count
class Point(object):
def __init__(self, pp):
self.x, self.y = pp
View pachinko.py
#!/usr/bin/env python3
from numpy import matrix, zeros
class RandomWalk(object):
limpow = 10**9
offset = [(0,-1), (0,1), (-1,0), (1,0)]
@neizod
neizod / it.ipynb
Created May 11, 2015
test nbviewer
View it.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View hellgist.b
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<-.>------.++++++++++.+.>+.>.
@neizod
neizod / LICENSE.txt
Created Oct 2, 2011 — forked from 140bytes/LICENSE.txt
GCD - recursive style, variable arguments.
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Nattawut Phetmak <http://about.me/neizod>
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
@neizod
neizod / LICENSE.txt
Created Oct 5, 2011 — forked from 140bytes/LICENSE.txt
Factorization
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Nattawut Phetmak <http://about.me/neizod>
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
@neizod
neizod / LICENSE.txt
Created Oct 6, 2011 — forked from 140bytes/LICENSE.txt
Substitution Cipher
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Nattawut Phetmak <http://about.me/neizod>
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
View zzz.py
import time
i,j=0,0
while True:
if not j:
time.sleep(0.5)
print("\r",end='')
if not i:
print("Z",end='')
else: