Skip to content

Instantly share code, notes, and snippets.

View Macuyiko's full-sized avatar

Seppe vanden Broucke Macuyiko

View GitHub Profile
import win32com.client
from flask import Flask, request, jsonify
def get_corrections(text, language=1033):
# See https://technet.microsoft.com/en-us/library/cc179219.aspx for a list of language ids
word = win32com.client.Dispatch('Word.Application')
word.Visible = True
wordDoc = word.Documents.Add()
wordDoc.Range().LanguageID = language
@Macuyiko
Macuyiko / smoothlife.pde
Created January 8, 2017 16:33
SmoothLife implementation in processing
//Quick adaption from:
//- http://jsfiddle.net/mikola/aj2vq/
//- https://0fps.net/2012/11/19/conways-game-of-life-for-curved-surfaces-part-1/
import java.util.*;
int INNER_RADIUS = 7;
int OUTER_RADIUS = 3 * INNER_RADIUS;
double B1 = 0.278;
double B2 = 0.365;
import youtube_dl
import sys
import os
sys.path.append('.')
if len(sys.argv) <= 1:
print("Usage: {} URL-OR-ID [OUTPUT_DIR] [SECONDS-BETWEEN]".format(__file__))
exit()
import requests
from bs4 import BeautifulSoup
from requests_oauthlib import OAuth1
from urllib.parse import parse_qs
from datetime import datetime
consumer_key = '----- obtain this from tumblr -----'
secret_key = '----- obtain this from tumblr -----'
# Replace with your Blog / Delicious profile:
@Macuyiko
Macuyiko / morningstar.py
Last active January 6, 2016 19:52
Simple scraper proof of concept for Morningstar ETFs
import requests
from bs4 import BeautifulSoup
import re
def get_viewstate(soup):
mainform = soup.find('form', {"action":"/uk/etfquickrank/default.aspx"})
return {
'__VIEWSTATE': mainform.find("input", {"name":"__VIEWSTATE"})['value'],
'__EVENTVALIDATION': mainform.find("input", {"name":"__EVENTVALIDATION"})['value']
}
import java.io.FileNotFoundException;
import java.util.Date;
import org.pdfclown.documents.Document;
import org.pdfclown.documents.Page;
import org.pdfclown.documents.contents.ContentScanner;
import org.pdfclown.documents.contents.Contents;
import org.pdfclown.documents.contents.composition.PrimitiveComposer;
import org.pdfclown.documents.contents.objects.ContentObject;
import org.pdfclown.documents.contents.objects.Path;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.List;
#! /usr/bin/env python
# Copyright 2010--2013 Christian Kreibich. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
@Macuyiko
Macuyiko / mod_muantiloris.c
Created January 10, 2011 21:01
Modified version of mod_antiloris
/*
mod_muantiloris 0.4
Copyright (C) 2008 Monshouwer Internet Diensten
Author: Kees Monshouwer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@Macuyiko
Macuyiko / slowloris.php
Created January 9, 2011 17:15
PHP based slowloris attack with slow headers or post variants. Adapted from script here: <http://seclists.org/fulldisclosure/2009/Jun/207>
#! /usr/bin/env php
<?php
/* PHP Slowloris
* Adapted from the script found here: http://seclists.org/fulldisclosure/2009/Jun/207
* Contains get based attack (slow headers) and post based attack (long content length)
*
* Author: Seppe vanden Broucke
*/
function usage($argv){