Instantly share code, notes, and snippets.

View gog_unrar.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Unpack wrapper for GOG.com installers using password-protected RAR files"""
from __future__ import (absolute_import, division, print_function,
with_statement, unicode_literals)
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__appname__ = "gog_unrar.py"
__version__ = "0.1rc1"
View ncmv.sh
#!/bin/sh
# Light-weight script for moving files across a network
#
# To use:
# 1. Make sure tar, netcat, and pv are installed.
# 2. Edit TARGET_IP and TARGET_PORT
# 3. Run with `--listen` on the target machine.
# 3. Run with files/folders to move as arguments on the source machine.
#
# Troubleshooting:
View install.sh
#!/bin/sh
#
# Simple XDG Install Script for Linux Games
#
# Features:
# - Communicates with the desktop via the xdg-utils vendor integration scripts.
# (No need to upgrade if the implementation details change.)
# - Icons are resolved via the desktop theming system, granting theme
# developers the ability to provide customized versions which preserve the
# overall system aesthetic.
View Cargo.toml
[package]
name = "unimportant_if_subsumed_by_setuptools"
version = "0.1.0"
authors = ["Your Name Here <your@email.com>"]
[lib]
name = "unimportant_if_subsumed_by_setuptools"
crate-type = ["cdylib"]
[dependencies.cpython]
View pagination_example.sql
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10
View png2pdf.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A simple tool for converting batches of PNG pages into a PDF file.
Usage:
1. Drop into the folder with the PNGs.
2. chmod +x png2pdf.py
3. Double-click it.
Requires:
View boilerplate.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""[application description here]"""
__appname__ = "[application name here]"
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__version__ = "0.0pre0"
__license__ = "GNU GPL 3.0 or later"
import logging
View x11_watch_active_window.py
#!/usr/bin/env python
"""python-xlib example which reacts to changing the active window/title.
Requires:
- Python
- python-xlib
Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib
for Python 3.x.
View timestamp.rs
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::panic::catch_unwind;
/// Variation on `std::time::Duration` that sacrifices a bit of precision on the positive
/// side of the in order to provide a nicely serializable form for `SystemTime` values.
///
/// (Workaround for https://github.com/serde-rs/json/issues/464)
#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
pub struct Timestamp {
View firefox_migration.rst

Disaster Plans for Firefox XUL Sunset

Public URL:Github Gist
Status: Incomplete
Last Updated:2018-07-07 12:48 EDT

Threat Summary