Skip to content

Instantly share code, notes, and snippets.

@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

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 / 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"
@chocolatkey
chocolatkey / jboxstatus.js
Last active April 3, 2017 09:41
Google Sheets API parsing example
/*
* Jaimini's Box status page
* Henry (chocolatkey) 2017
*/
// Reader DB
var mangaz = [[!status6]];
//https://stackoverflow.com/questions/4992383/use-jquerys-find-on-json-object
function getObjects(obj, key, val) {
@chocolatkey
chocolatkey / chgrub2env.sh
Created June 2, 2017 23:07
Change Grub2 default menu entry
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
echo "=================================="
echo "Grub2 selected menu entry changer"
echo "=================================="
cenvraw=$(grub2-editenv list)
cenv=${cenvraw#*=}
@chocolatkey
chocolatkey / .bashrc
Created October 14, 2017 23:54
babbage bash config
# Only load Liquid Prompt in interactive shells, not from a script or from scp
[[ $- = *i* ]] && source ~/liquidprompt/liquidprompt
# Muh colors!
alias grep='grep --color' # show differences in colour alias
egrep='egrep --color=auto' # show differences in colour
alias fgrep='fgrep --color=auto' # show differences in colour
alias ls='ls -hF --color=tty' # classify files in colour
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'