Skip to content

Instantly share code, notes, and snippets.

View vampy's full-sized avatar

Daniel Butum vampy

View GitHub Profile
@vampy
vampy / stripectflevel8solution.py
Created August 29, 2012 19:50
Stripe CTF 2.0 level 8 solution
#!/usr/bin/env python
import httplib
import socket
from json import dumps
from random import randint
from datetime import datetime
from sys import getsizeof
#Timing Start
startTime = datetime.now()
@vampy
vampy / getArrayFromIcons.js
Created September 29, 2012 20:22
Generate PHP array("key" => "class-name") from Icon glyphs documentation for Twitter Bootstrap
//@link http://twitter.github.com/bootstrap/base-css.html#icons
var bigOutput = "array(\n";
var number = 1;
//how many results per line
var resultsPerLine = 4;
$("#icons .the-icons i").each(function(index)
{
var vector = (this.className).split("-");
//console.log(index + " : " + this.className +" : " + vector);
// Read a certain number of character from the keyboard
// put it in *string
// return the number of characters read
int read_string(char *string, int read_length)
{
char read_char;
int i = 0;
// weird case when we have \n on our first character
if((read_char = getchar()) != '\n')
#!/usr/bin/env python2
import sys
"""
You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists.
For example,
List 1: [4, 10, 15, 24, 26]
List 2: [0, 9, 12, 20]
List 3: [5, 18, 22, 30]
The smallest range here would be [20, 24] as it contains 24 from list 1, 20 from list 2, and 22 from list 3.
@vampy
vampy / os.h
Last active August 29, 2015 14:07
General usable functions for OS course
#pragma once
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <limits.h>
#include <fcntl.h>
#include <errno.h>
#include <ctime>
#include <string>
class Time
{
public:
static std::string getTime() // in HH:MM::SS
{
std::time_t t = std::time(nullptr);
std::tm *tm = std::localtime(&t);