Skip to content

Instantly share code, notes, and snippets.

@nkmathew
nkmathew / comfy-night-mode.css
Last active October 5, 2016 19:23
Bearable styling for Reddit in Night Mode
/**
* Created because RES's CSS style for inline code sucks in Night Mode and to remove some
* other minor annoyances
*
* Home: https://gist.github.com/nkmathew/354f2dc2849863201a30
* Stylish Userstyle: https://userstyles.org/styles/119199/comfy-reddit-night-mode
*
* RES 4.6.0 was released on 10th January 2016 with completely new stylesheets for
* Night Mode making this user style somewhat obsolete. It'll only work well with
* v4.5.4 released 30th December 2014 and below
@nkmathew
nkmathew / .gitignore
Last active September 17, 2015 11:22
Script for downloading bookmarks from Opera Link
*.html
#!/usr/bin/env python3
"""
Runs a simple HTTP Server locally on port 80
Created to handle mime types not handled in http.server
Usage:
python -m MyServer
"""
import time
@nkmathew
nkmathew / githubclone.py
Last active April 4, 2017 16:14
Script for cloning all projects and gists
#!/usr/bin/env python3
"""
Date: 9th August 2015
Author: nkmathew
A script for cloning all projects and gists from my Github account when I move to a
new environment
USAGE:
#!/bin/bash
for i in `seq 1 1542`; do
rm index.html
wget http://xkcd.com/$i/
IMG_URL=$(grep http://imgs.xkcd.com/comics/ index.html | head -1 | awk -F': ' '{print $2}')
IMG_NAME=$(echo $IMG_URL | awk -F'comics/' '{print $2}')
FULL_NAME="xkcd-$i-$IMG_NAME"
wget $IMG_URL -O $FULL_NAME
done
#!/bin/bash
#
# A script for changing login/desktop/lockscreen backgrounds
RED="\033[0;31m"
NC="\033[0m" # No Color
XML_FOLDER=/usr/share/images/desktop-base
WIDTH=1920
HEIGHT=1200
@nkmathew
nkmathew / hla_formatter.py
Created March 7, 2014 18:24
Primitive code formatter for the HLA(High Level Assembly) programming language
'''
@Started: 1st March 2014 1630
@Completed: 5th March 2014 0800
A hacked up script to help you survive through the Art of Assembly
Programming's rather awful formatting.
Alas, it has many flaws. It'll be helpful with only the most trivial of scripts.
'''
@nkmathew
nkmathew / nasm-print-diamond.asm
Last active August 29, 2015 13:56
An assembly(NASM) program that prints a diamond pattern
;; @started: 19th February 2014 20:30
;; @completed: 23rd February 2014 11:20
;; Original C program
;; #include <stdio.h>
;;
;; void print_diamond(int width) {
;; /*
;; ** Every level is has two less or more characters than the next.
#!/usr/bin/python2.7
## @Date: 21st February 2014, 16:00
"""
This code is supposed to help you paste to www.pastebin.com from the command
line as a Guest does in the web interface. The old pastebin
api(www.pastebin.com/api_public.php) has been deprecated in favor of the new
one(www.pastebin.com/api) which requires an api_key that can only be obtained by a
registered user.
@nkmathew
nkmathew / my-gcc.py
Last active January 18, 2018 07:37
A script for running single C/C++ files from SciTE
#!/usr/bin/python2.7
import os
import sys
import platform
import subprocess
import re
"""
This program runs gcc/g++ on a cpp/c source file. It supposed to be used in