Skip to content

Instantly share code, notes, and snippets.

@chocolatkey
chocolatkey / slack.php
Created October 23, 2015 18:09
Slack team invite sign-up form handler
<?php
/*
Slack team invite sign-up form handler
Henry Stark 2015
Original Idea: https://levels.io/slack-typeform-auto-invite-sign-ups/
*/
/* VARIABLES TO EDIT */
$slackTeam = 'scanlation';// Slack team name
$slackToken = 'xoxp-1234';// Slack API token (Generate at https://api.slack.com/web)
@chocolatkey
chocolatkey / foolfeed.php
Last active October 24, 2015 20:52
Foolslide RSS feed formatter for front page presentation (Foundation 5)
<?php
//FoolSlide RSS Feed loader/formatter
//TODO: Use API instead of RSS feed
//Henry Stark 2015
//ini_set('display_errors', 1);
//error_reporting(E_ALL ^ E_NOTICE);
$curl = curl_init();
curl_setopt_array($curl, Array(
CURLOPT_URL => 'http://[INSERT FOOLSLIDE BASE URL]/feeds/rss/',
@chocolatkey
chocolatkey / csvexport.js
Created January 21, 2016 18:08
Export CSV of table (bootstrap, checkbox/empty column safe)
//Original function: https://jsfiddle.net/terryyounghk/kpegu/
function exportTableToCSV($table, filename) {
var $rows = $table.find('tr:has(td)'), //Put tr:has(input:checkbox:checked) for ones with checked checkboxes
// Temporary delimiter characters unlikely to be typed by keyboard
// This is to avoid accidentally splitting the actual contents
tmpColDelim = String.fromCharCode(11), // vertical tab character
tmpRowDelim = String.fromCharCode(0), // null character
@chocolatkey
chocolatkey / foolfeed2.php
Last active May 6, 2016 17:50
Foolslide latest releases fetcher for front page presentation (Foundation 5)
<?php
//FoolSlide RSS Feed loader/formatter v2
//Henry Stark 2016
//ini_set('display_errors', 1);
//error_reporting(E_ALL ^ E_NOTICE);
//CONFIG///////////////////////////////
$url_prefix = "//PATH_TO_FOOLSLIDE/";//Fooslide location
require_once("/PATH_TO_medoo.php");//Path to medoo
@chocolatkey
chocolatkey / collatz.cpp
Last active June 15, 2018 19:06
Collatz conjecture output to file
/**
* Collatz conjecture (multithreaded, C++)
* chocolatkey 2016
*/
// STUFF YOU CAN CHANGE
#define MAX_THREADS 512 // For self-restraint
#define MODE 0 // 0 = RAM storage (warning: can eat up ram quickly with calculations > 1000000 iterations), 1 = HDD split files storage (very low RAM usage, but more disk r/w))
// END OF STUFF

Keybase proof

I hereby claim:

  • I am chocolatkey on github.
  • I am chocolatkey (https://keybase.io/chocolatkey) on keybase.
  • I have a public key whose fingerprint is 50E5 28E0 F896 FA06 CF88 32F0 43B7 B2E0 0E2D 335F

To claim this, I am signing this object:

#!/bin/bash
echo "-------------------------------"
echo "| OxfordOrb by chocolatkey |"
echo "-------------------------------"
rm -R -- */ # Clean slate
for f in *.orb; do unzip -d "${f%*.orb}" "$f"; done
for D in *; do
@chocolatkey
chocolatkey / mangafoxscraper.py
Last active February 12, 2017 17:20
Python's slowly growing on me...
# Mangatown Scraper 1.2
# Henry (chocolatkey) 2017
# coding=utf-8
import urllib.request
from bs4 import BeautifulSoup
import re
import threading
import time
import logging
import os
@chocolatkey
chocolatkey / EBookJapanRipper.user.js
Last active September 3, 2020 21:11
Doesn't work right now
// ==UserScript==
// @name EBookJapanRipper
// @version 1.10
// @downloadURL https://gist.githubusercontent.com/chocolatkey/ad0c04b0768f5fcdd3ea3c6cb089b8b2/raw
// @supportURL https://gist.github.com/chocolatkey/ad0c04b0768f5fcdd3ea3c6cb089b8b2
// @description Send my regards to "t-hamaguchi" lol
// @author chocolatkey
// @homepage https:/github.com/chocolatkey
// @include http://*br.ebookjapan.jp*
// @include https://*br.ebookjapan.jp*
@chocolatkey
chocolatkey / icons8fetch.py
Created February 20, 2017 11:22
Proof of concept
# Icons8 fetcher
import json
import urllib.request
import os
import sys
import argparse
import re
apihome = "https://api.icons8.com/api/iconsets/v3/search"