Skip to content

Instantly share code, notes, and snippets.

View evandrix's full-sized avatar
💭
offline

evandrix evandrix

💭
offline
View GitHub Profile
#include <bitset>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
bool inner(const bitset<91>& a, const bitset<91>& b) {
return ((a & b)).count() & 1;
from crc64 import crc64
mem = map(chr, [65, 77, 150, 2, 54, 40, 50, 4, 1, 24,
96, 2, 231, 191, 200, 200, 224, 221, 242, 255,
65, 224, 221, 36, 28, 237, 200, 224, 221, 204,
72, 63, 232, 162, 87, 122, 185, 200, 224, 221,
65, 224, 221, 29, 230, 181, 204, 72, 63, 200,
224, 221, 200, 224, 221, 76, 177, 34, 127, 127,
65, 200, 224, 221, 200, 224, 221, 200, 224, 221,
242, 255, 76, 177, 34, 200, 224, 221, 200, 224,
@mattsta
mattsta / bench.pl
Created June 22, 2014 05:41
Quick Redis speed comparison script
#!/usr/bin/perl
use warnings;
use strict;
use IO::All;
use IO::Socket::UNIX qw( SOCK_STREAM );
use Benchmark ':hireswallclock';
use Redis;
use RedisDB;
'''
Project Euler problem 477
url: https://projecteuler.net/problem=477
'''
import sys
def sequence_gen(n):
ret = 0
i = 0
while i < n:
@shamansir
shamansir / arithmetics-parser.pegjs-0-6-2.js
Created September 6, 2014 22:39
Comparison between parser generated with `pegjs` and parser generated with `pegjs-fn` – 2
module.exports = (function(){
/* Generated by PEG.js 0.6.2 (http://pegjs.majda.cz/). */
var result = {
/*
* Parses the input with a generated parser. If the parsing is successfull,
* returns a value explicitly or implicitly specified by the grammar from
* which the parser was generated (see |PEG.buildParser|). If the parsing is
* unsuccessful, throws |PEG.parser.SyntaxError| describing the error.
*/
@g05u
g05u / csaw_2014_xorcise.py
Created September 21, 2014 22:33
CSAW CTF 2014 - xorcise exploit
#!/usr/bin/env python
import struct, sys, time
from nulllife import *
#CSAW 2014 CTF
#xorcise exploit
def xor(data, key):
o = ''
for i in range(len(data)):
@g05u
g05u / csaw_2014_greenhorn_exploit.py
Created September 21, 2014 22:05
Exploit greenhornd CSAW 2014 CTF
#!/usr/bin/env python
import struct, sys, time
from nulllife import *
#CSAW 2014 CTF
#greenhorn exploit
offset_data = 0x3F8
s = NullSocket("54.164.253.42", 9998)
s.readuntil("Password: ")
@rm-hull
rm-hull / hilbert-curve.cljs
Last active August 29, 2015 14:06
A Hilbert space-filling curve is a fractal first discovered by German mathematician David Hilbert in 1891. It is commonly used in mapping applications because they give a mapping between 1D and 2D space that fairly well preserves locality. Michelle Brush gave an excellent talk at Strangeloop 2014 entitled _Practical Fractals in Space_ (https://w…
(ns enchilada.hilbert-curve
(:require
[big-bang.core :refer [big-bang]]
[big-bang.events.browser :refer [offset-coords]]
[jayq.core :refer [show attr css]]
[enchilada :refer [ctx canvas]]
[inkspot.color-chart :as color-chart]
[monet.canvas :refer [begin-path move-to line-to
fill-rect fill-style
clear-rect stroke stroke-style stroke-width
@SethTisue
SethTisue / scalawags-21.md
Last active August 29, 2015 14:06
Scalawags #21 show notes

Scalawags #21

Take special note of the masterfully smooth topic segues throughout.

YouTube link: https://www.youtube.com/watch?v=xYZ0ZctrgTg

intro (0:00)

  • Daniel is crushed by a giant cat
  • Seth dusts off his radio announcer voice
@dencorg
dencorg / telnetgame.py
Last active August 29, 2015 14:18
Hacky Easter Egg 23
# coding=utf-8
import telnetlib
import json
from random import randint
def find_answer(question, data):
for entry in data:
if entry['question'] == question:
return entry['answer'].encode('utf-8')
data.append({'question': question, 'answer': ""})