Skip to content

Instantly share code, notes, and snippets.

@dmn001
dmn001 / Dropbox-Diet Solution
Created February 1, 2011 14:03
My solution for the Dropbox Diet Challenge
#!/usr/bin/perl
use strict;
# dmn001 <at> gmail
# 31/01/2011
my %pos;
my %neg;
my $num_lines = <STDIN>;
while (<STDIN>){
@dmn001
dmn001 / gist:1889341
Created February 23, 2012 02:32
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+X delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
my $file = $ARGV[0];
open FILE, "<", $file or die;
while (<FILE>){
chomp;
prefix_expression($_);
}
close FILE;
sub prefix_expression{
@dmn001
dmn001 / background.js
Last active December 16, 2015 16:39
Block Misspelled Websites
// This file is part of Block Misspelled Websites Chrome Extension.
//
// Block Misspelled Websites Chrome Extension is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Block Misspelled Websites Chrome Extension is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
import logging
import multiprocessing
import time
import mplog
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
existing_logger = logging.getLogger('x')
@dmn001
dmn001 / market_history_json_parse.py
Last active June 27, 2016 11:48
parse sold item date, name and price
import json
from bs4 import BeautifulSoup
import re
of = open("all_output.txt", "wb")
for file_num in range(1,102):
filename = "%03d.json" % file_num
print filename
@dmn001
dmn001 / hotukdeals-imagus.txt
Last active July 18, 2017 13:12
hotukdeals sieve for imagus
{"hotukdeals":{"img":"(images\\.hotukdeals\\.com/threads/thread_)([a-z_]+)+","to":"$1full_screen"}}
@dmn001
dmn001 / apple tv screensavers download command.txt
Last active December 9, 2023 00:50
apple tv screensavers
cat urls.csv | sed 's/\([^,]*\),\(.*mov\)\r/wget "\1" -O "\2"/' | sh
the location and time of day are prepended to the filename.
@dmn001
dmn001 / tmux-cheatsheet.markdown
Created August 22, 2017 14:04 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname