Skip to content

Instantly share code, notes, and snippets.

@arminrosu
arminrosu / base64_encode_images
Last active June 6, 2016 22:05
Batch base64 encode images in a directory for CSS
<pre><?php
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* Batch base64 encode images and output css
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
// list images in ./images/ directory
$directory = dirname(realpath(__FILE__));
$images_dir = $directory . '/images/';
$images = get_images($images_dir);
@arminrosu
arminrosu / class.orphanfinder.php
Last active December 15, 2015 10:19
Parse css for orphan images (i.e. on disk but not in css)
<pre><?php
class OrphanFinder {
private $imagesDir = "";
private $imagesUrl = ""; // base path
private $stylesheetsDir = "";
function __construct($imagesDir, $imagesUrl, $stylesheetsDir) {
$this->imagesDir = $imagesDir;
$this->imagesUrl = $imagesUrl;
@arminrosu
arminrosu / wp_sfs.js
Last active December 18, 2015 02:09
Lazy man's way of adding wordpress spam users to stopforumspam database
var key = '12345678901234';
jQuery('#the-list tr').each(function(){
$tr = jQuery(this);
var spammer = {
'username': $tr.find('.username a').first().text(),
'email': $tr.find('.email a').children().remove().end().text(),
'ip_addr': $tr.find('.signup_ip em').text(),
'api_key': key
@arminrosu
arminrosu / Gruntfile.js
Last active November 15, 2015 08:42
Compass SVG Sprite via Grunt
svgsprite: {
options: {
padding: 10,
prefix: 'icon',
layout: 'diagonal', // OR 'vertical' OR 'horizontal'
render: {
css: false,
compass: {
template: 'path/to/template.js',
dest: 'path/to/_svg_sprites.scss'
@arminrosu
arminrosu / gmail_find_iphones_notes.txt
Last active April 21, 2016 10:15
Select iPhone Note drafts in Gmail
# Gmail Search Query that finds iPhone Draft Notes
#
# iPhone creates a new gmail message whenever you change a Note
# These are saved with a `X-Uniform-Type-Identifier: com.apple.mail-note` header
# But without a label or delivery address
#
# We are searching for messages with no TLD extension in the _to_ field
# It should return all Draft notes, but check them anyway.
has:nouserlabels -deliveredto:me -is:important -to:(ac|ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|as|asia|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|info|int|io|iq|ir|is|it|je|jm|jo|jobs|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mobi|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|p
@arminrosu
arminrosu / server.py
Created September 19, 2016 13:57
Basic Python HTTPS JSON Server
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import ssl
import SocketServer
import json
import cgi
class Server(BaseHTTPRequestHandler):
def _set_headers(self):
self.send_response(200)
self.send_header('Content-type', 'application/json')
@arminrosu
arminrosu / index.coffee
Created May 1, 2017 07:58
Übersicht - Coindesk Bitcoin Ticker
###
Coindesk Bitcoin Ticker
Author: Armin Rosu ([email protected])
###
command: ""
# The widget updates itself, so no need to refresh anything
refreshFrequency: '1h'
@arminrosu
arminrosu / History|-1004c7ea|entries.json
Last active March 28, 2023 08:34
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/armin/repositories/%40caya/backend/packages/utils/src/documentFilename.spec.ts","entries":[{"id":"CVBF.ts","source":"searchReplace.source","timestamp":1660807936055},{"id":"M1WB.ts","timestamp":1661855983060}]}
@arminrosu
arminrosu / matamask.txt
Created August 28, 2017 19:50
Rinkeby ETH Test Net Faucet Address
0x4522efDE45db1B6E53759a35eFdE98A5B5Ae7Df4
@arminrosu
arminrosu / endpoints.md
Last active July 4, 2020 08:35 — forked from derhuerst/_.md
List of HAFAS API Endpoints

List of HAFAS API Endpoints

This is a list of HAFAS API endpoints, all with different data versions, API versions, output formats and URL configurations. Help me complete this list!

todo: http://www.fahrplanauskunftssysteme.de/?seitenID=27

Table of Contents