Skip to content

Instantly share code, notes, and snippets.

@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active March 21, 2025 15:01
Backend Architectures Keywords and References
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.
@scturtle
scturtle / snake.py
Last active April 29, 2018 02:27
snake AI demo with pygame
import pygame
import random
from Queue import Queue, deque
from pygame.color import Color
d = 20
WIDTH = 15
HEIGHT = 10
LEFT, RIGHT, UP, DOWN = -1, 1, -WIDTH, WIDTH
@scturtle
scturtle / ttt.py
Last active December 17, 2015 06:08
tic tac toe AI
import random
opmv = {'O': 'X', 'X': 'O'}
def print_grid(grid):
print '\n' + '\n'.join(' '.join(line) for line in zip(*[iter(grid)]*3))
def possible(grid):
return [i for i in xrange(9) if grid[i] == '_']
@scturtle
scturtle / pq.py
Last active December 17, 2015 05:38
Priority queue (allow priority changes)
''' Priority queue implemented by heap.
Some codes are copied from the official library heapq.
Priority changes for queue item is possible and fast. '''
class PQ:
def __init__(self):
self.heap = []
self.priority = {}
self.position = {}
@isnowfy
isnowfy / dft.py
Last active July 5, 2019 04:29
dft
# Example usage
# $ python dft.py | gnuplot
# 9
# 0 0
# 1 1
# 2 2
# 0 2
# 1 1
# -1 1
# 0 2
@scturtle
scturtle / config.fish
Last active December 16, 2015 11:48
powerline prompt for fishfish (with patched font)
set DARKGREEN 2b6003
set LIGHTGREEN b7da2d
set DARKBLUE 2f6f93
set LIGHTBLUE 87d6fc
set SPARATOR \u2b80
set SPARATOR_THIN \u2b81
function fish_prompt
# first line
set_color -o $DARKGREEN -b $LIGHTGREEN
@securitytube
securitytube / wlan-ssid-sniffer-python-raw-sockets.py
Created April 2, 2013 14:56
WLAN SSID Sniffer in Python using Raw Sockets
#!/usr/bin/env python
import socket
rawSocket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(0x0003))
rawSocket.bind(("mon0", 0x0003))
ap_list = set()
while True :
pkt = rawSocket.recvfrom(2048)[0]
if pkt[26] == "\x80" :
if pkt[36:42] not in ap_list and ord(pkt[63]) > 0:
ap_list.add(pkt[36:42])
@securitytube
securitytube / ssid-sniffer-scapy-python.py
Created April 2, 2013 12:49
WLAN SSID Sniffer in Python using Scapy
#!/usr/bin/env python
from scapy.all import *
ap_list = []
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :
@scturtle
scturtle / rr.py
Created February 27, 2013 06:51
timeline of any user in renren.com
# coding: utf-8
from __future__ import unicode_literals
import re
import sys
import requests
import HTMLParser
cookie_t = ''
uid = ''
filename = ''