Skip to content

Instantly share code, notes, and snippets.

@jonmaim
jonmaim / zip.php
Last active January 22, 2024 00:19
PHP script to remotely create zip archives of your FTP
<?php
/*
*
* This script will backup your web site by remotely archiving all files on the root FTP directory.
* It will work even if your web server is memory limited buy splitting zips in several arhive files it they are too many files.
* All zip files will be stored in a directory called temporary which must be writable.
*
* How to use it:
* - Place the script at the root of your FTP.
@sirleech
sirleech / gist:2660189
Created May 11, 2012 14:42
Python Read JSON from HTTP Request of URL
# Load Json into a Python object
import urllib2
import json
req = urllib2.Request("http://localhost:81/sensors/temperature.json")
opener = urllib2.build_opener()
f = opener.open(req)
json = json.loads(f.read())
print json
print json['unit']
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@johnantoni
johnantoni / startup_mailer.py
Created December 31, 2013 16:21
raspberry pi - send email on startup (will need gmail account to send from)
import subprocess
import smtplib
import socket
from email.mime.text import MIMEText
import datetime
# Change to your own account information
to = 'me@example.com'
gmail_user = 'test@gmail.com'
gmail_password = 'yourpassword'
smtpserver = smtplib.SMTP('smtp.gmail.com', 587)
@kfigiela
kfigiela / Denon_RC-1163_lircd.conf
Last active October 5, 2018 15:15
LIRC config file for Denon RC-1163 remote for DRA-F109/DNP-F109/DCD-F109
# contributed by Kamil Figiela
#
# brand: Denon
# model no. of remote control: RC-1163
# devices being controlled by this remote: DRA-F109/DNP-F109/DCD-F109
#
# DRA-F109 has also serial port in its "Remote Connector" that provides better integration.
# See blog post for more information: http://kfigiela.github.io/2014/06/15/denon-remote-connector/
begin remote
@kyle-ilantzis
kyle-ilantzis / open-w-atom.reg
Last active June 1, 2021 17:20
Adds 'Open in Atom' to context menu in Windows Explorer.
Windows Registry Editor Version 5.00
;
; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer.
;
; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work
; https://github.com/Zren/atom-windows-context-menu/issues/1.
;
; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with
; the path to the atom executable on your machine.
@mayo
mayo / README.md
Created March 11, 2015 07:19
Convert Simplenote Export JSON file into multiple Markdown files

SimpleNote to Markdown

This script converts JSON file from Simplenote Export web service into individual Markdown files.

It's nothing fancy, first argument is the JSON file, second argument is directory to write the notes to. The note files are named by using the first 60 characters (or a little more, up to a full word) of the first line of the note, stripped of any characters outside of letters, simple dash, underscore, brackets, space, single quote, and plug and equal signs.

Tags are stored on the bottom of the note on a line starting with "TAGS:", and the SimpleNote note ID/key as a "KEY:" line.

@biggyspender
biggyspender / instructions.txt
Last active October 22, 2018 13:33
install mopidy/mopify/moped with libspotify on Raspberry Pi 2 fresh Raspbian image
sudo apt-get update
sudo apt-get upgrade -y
mkdir ~/mopidytemp
cd ~/mopidytemp/
wget https://apt.mopidy.com/mopidy.gpg
sudo apt-key add mopidy.gpg
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/mopidy.list
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install python-pip
@AurumProject
AurumProject / Ajax synchronous alternative (Jquery)
Created April 15, 2015 23:26
Ajax synchronous alternative - Jquery synchronous xmlhttprequest on the main thread is deprecated
/*/
Fixes bug that freeze Node JS Webkit (NWJS) with "async:false";
"Jquery synchronous xmlhttprequest on the main thread is deprecated"
It is also an alternative to execute code after the ajax response
/*/
function Server_Async(){
return $.ajax({
type: "POST",
url: "../example.php",
@mistic100
mistic100 / Mediakeys.ahk
Last active May 1, 2024 00:47
Media keys shortcuts for AutoHotkey
; AutoHotkey Media Keys
^!Space::Send {Media_Play_Pause}
^!Left::Send {Media_Prev}
^!Right::Send {Media_Next}
^!NumpadMult::Send {Volume_Mute}
^!NumpadAdd::Send {Volume_Up}
^!NumpadSub::Send {Volume_Down}