Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
lucaswerkmeister / watch
Created March 20, 2015 16:24
Watch a website and get emailed on changes
#!/bin/bash
url="${1:?Usage: $0 url [recipient...]}"
shift
sha=$(curl -s $url | shasum);
while [[ $sha = $(curl -s $url | shasum) ]]; do
sleep 15;
done
sendmail=$(type -p sendmail || { [[ -x /usr/sbin/sendmail ]] && echo /usr/sbin/sendmail || { echo "Can’t find sendmail!"; exit 1; }; });
$sendmail -F 'Website Watcher Bot' -f "bot+watcher@$HOSTNAME" "${@:-mail@$HOSTNAME}" << EOF
Subject: Website changed
@nl5887
nl5887 / transfer.fish
Last active July 30, 2024 09:21
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@pklaus
pklaus / ddnsserver.py
Last active March 24, 2025 19:48 — forked from andreif/Simple DNS server (UDP and TCP) in Python using dnslib.py
Simple DNS server (UDP and TCP) in Python using dnslib.py
#!/usr/bin/env python
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import argparse
import datetime
import sys
import time
import threading
@mrwilson
mrwilson / do_codes_20140729.yml
Last active August 29, 2015 14:04
get_digital_ocean_codes.sh
# regions
do_regions_sfo1: 3
do_regions_nyc2: 4
do_regions_ams2: 5
do_regions_sgp1: 6
do_regions_lon1: 7
# sizes
do_sizes_32gb: 60
do_sizes_16gb: 61
@d3noob
d3noob / .block
Last active July 11, 2023 19:59
Simple vertical d3.js tree diagram
license: mit
@d3noob
d3noob / .block
Last active November 30, 2019 18:19
Simple d3.js tree diagram
license: mit
@robschmuecker
robschmuecker / README.md
Last active March 28, 2025 14:54
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@adewes
adewes / get_active_window.py
Last active February 28, 2024 23:26
Get the active window in Gtk using the wnck library.
import wnck
import gtk
import time
if __name__ == '__main__':
screen = wnck.screen_get_default()
screen.force_update()
while True:
while gtk.events_pending():
gtk.main_iteration()
@bkdinoop
bkdinoop / login-example
Last active May 21, 2024 06:25
Flask-Login : login.py created by https://github.com/maxcountryman : Matthew Frazier
# -*- coding: utf-8 -*-
"""
Flask-Login example
===================
This is a small application that provides a trivial demonstration of
Flask-Login, including remember me functionality.
:copyright: (C) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
"""