Skip to content

Instantly share code, notes, and snippets.

@jn0
jn0 / pelco_d.py
Created November 27, 2018 09:05
PELCO-D Protocol
# -*- coding: utf-8 -*-
'''The Pelco-D Protocol
Standard Number TF-0002
Version 2 Revision 1 Release Date August 15, 2003
Transmitters will format a single character and receivers will be able to
decipher a single character as: 1 start bit, 8 data bits, 1 stop bit,
and no parity.
@gmolveau
gmolveau / uuid_user.py
Last active May 6, 2024 17:55
sqlalchemy uuid for sqlite
########################
# UUID for SQLite hack #
########################
from sqlalchemy.types import TypeDecorator, CHAR
from sqlalchemy.dialects.postgresql import UUID
import uuid
class GUID(TypeDecorator):
@Firsh
Firsh / lwp-cloudflare-dyndns.sh
Last active July 2, 2024 02:55
Cloudflare as Dynamic DNS
#!/bin/bash
# Cloudflare as Dynamic DNS
# From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/
# Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/
# Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/
# Update these with real values
auth_email="email@example.com"
auth_key="global_api_key_goes_here"
zone_name="example.com"
@Sulkar
Sulkar / non-blockingTkinter.py
Created August 12, 2017 20:15
[python] non-blocking Tkinter thats uses .update_idletasks()
#
# non blocking Tkinter code -> uses of .update_idletasks()
#
import time
from tkinter import *
# Function: with timeout
def mySleep():
text.insert(INSERT, "start sleep\n")
@lalogrosz
lalogrosz / ucwords.ts
Created August 11, 2017 16:41
Angular ucwords Pipe
import { Injectable, Pipe } from '@angular/core';
@Pipe({
name: 'ucwords'
})
@Injectable()
export class UcwordsPipe {
/*
Takes a value and makes it lowercase.
*/
@kekru
kekru / Docker connect to remote server.md
Last active June 14, 2024 09:00
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@jbeales
jbeales / usps-abbreviations.php
Last active June 21, 2024 19:04
The official USPS abbreviations used in City & Street names, as a PHP array.
<?php
// based on: http://pe.usps.gov/text/pub28/28apc_002.htm
$usps_abbreviations = [
'ALLEY' => 'ALY',
'ANNEX' => 'ANX',
'ARCADE' => 'ARC',
'AVENUE' => 'AVE',
'BAYOO' => 'BYU',
'BEACH' => 'BCH',
@justinbellamy
justinbellamy / cltools.sh
Last active March 6, 2022 03:46 — forked from jellybeansoup/cltools.sh
Install Autoconf and Automake on OS X El Capitan
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
% 1. Title: Iris Plants Database
%
% 2. Sources:
% (a) Creator: R.A. Fisher
% (b) Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov)
% (c) Date: July, 1988
%
% 3. Past Usage:
% - Publications: too many to mention!!! Here are a few.
% 1. Fisher,R.A. "The use of multiple measurements in taxonomic problems"
@walkerjeffd
walkerjeffd / Synology-Diskstation-Git.md
Last active July 17, 2024 08:15
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation