Skip to content

Instantly share code, notes, and snippets.

View magical's full-sized avatar
🙀
🐛

Andrew Ekstedt magical

🙀
🐛
View GitHub Profile
@magical
magical / yahoo.py
Last active December 12, 2015 07:28
screen.yahoo.com video grabber
# Get a video url from screen.yahoo.com
# python3 yahoo.py 'http://screen.yahoo.com/raven-refused-sing-010647927.html' | xargs vlc
import sys
import contextlib
import json
import random
import re
import urllib.parse
import urllib.request
"""Analyze statistics of movepool typing"""
from __future__ import division
import pokedex.db
import pokedex.db.tables as t
from sqlalchemy import sql
import argparse
from itertools import groupby
puts "String.concat"
1.upto(10) do |i|
i *= 10000
start = Time.now()
s = ""
0.upto(i) {
s << 'a'
}
puts "#{i}: #{Time.now()-start}s"
end
@magical
magical / ambiguous-names.txt
Created September 16, 2013 18:35
Ambiguous names in veekun/pokedex
Altering Cave en location 490
Altering Cave en location 529
Antídoto es ability 90
Antídoto es item 18
Apricorn Box en item 446
Apricorn Box en item_category 40
Attack en conquest_stat 2
@magical
magical / gist:6878341
Created October 8, 2013 02:14
Pokemon level-up movepool sizes. The numbers on the left show the size of a pokemon's level-up moveset in the versions on the right. The last number is the product of those numbers. This is the cost (in both time and space) of performing an optimal multi-dimensional sequence alignment.
Bulbasaur
9 RBY
11 GSCRSECoXDFRLG
14 DPPtHGSSBWB2W2
1386
Ivysaur
10 RBY
13 GSCRSECoXDFRLG
16 DPPtHGSSBWB2W2
@magical
magical / sudoku.c
Last active December 30, 2015 21:09
sudoku solver
#include <stdint.h>
#include <stdio.h> /* fprintf, getchar, printf, putchar, stderr */
#include <stdlib.h> /* exit, free, malloc */
#include <string.h> /* memmove */
#define N 9
#define mask ((1<<N) - 1)
typedef uint16_t Cell;
Cell puz[N*N];
package main
import (
"fmt"
"io"
"os"
)
func main() {
if len(os.Args) != 4 {
@magical
magical / bch2obj.go
Last active December 13, 2015 23:42 — forked from smealum/bch2obj.py
package main
import (
"bytes"
"encoding/binary"
"flag"
"fmt"
"io"
"io/ioutil"
"math"
// Project euler #16
#include <stdio.h>
int digits[1000] = {1};
int len = 1;
void fold() {
int i, carry = 0;
for (i = 0; i < len; i++) {
; arguments
; ???
; ???
; target pokemon
; ball
; shakes (out param)
; crit (out param)
; output
; returns whether capture succeeded
; [r4] number of shakes