Skip to content

Instantly share code, notes, and snippets.

@vielhuber
vielhuber / script.sh
Last active October 30, 2024 01:42
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
anonymous
anonymous / private.xml
Created February 18, 2016 09:22
<?xml version="1.0"?>
<root>
<item>
<name>Remap ShiftL + F19 to Caps Lock</name>
<appendix>(ShiftL + F19 to Caps Lock)</appendix>
<identifier>usercustom.f19_shift_l_to_caps</identifier>
<autogen>
@RaD
RaD / .gitconfig
Last active September 27, 2021 09:26
Git Global Config
[gui]
encoding = utf-8
[alias]
#visual = gitk
last = log -1 HEAD
st = status
shorty = status --short --branch
# git unstage - убрать всё из индекса (чтобы например добавить/закоммитить сначала что-то другое)
unstage = reset HEAD --
up = !(git add . && git stash && git pull --rebase >&2) | grep -v \"No local changes to save\" && git stash pop
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 19, 2024 11:04
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@micheller
micheller / bit-converter
Created July 17, 2015 08:57
My colleague asked me to write function written to convert selected binary constants (ex. 0b11101) to decimal view and back.
;; The fist version. Tricky and workarounded.
;; you can test it on this:
;; var BITS = ( 29, 0, 63, 85, 34 )
(defun bit-compact (start end)
(interactive "r")
(defun int-to-binary-string (i)
"convert an integer into it's binary representation in string format"
@hartsock
hartsock / hosts_listing.py
Created December 22, 2014 22:08
A quick and dirty script to get all the hosts in a vCenter.
#!/usr/bin/env python
from __future__ import print_function
from pyVim import connect
from pyVmomi import vim
si = connect.SmartConnect(host='vcsa', user='my_user', pwd='my_password')
content = si.RetrieveContent()
@bancek
bancek / cue_to_mp3.py
Last active May 22, 2024 11:11
CUE splitter using ffmpeg (to mp3)
cue_file = 'file.cue'
d = open(cue_file).read().splitlines()
general = {}
tracks = []
current_file = None
@domgiles
domgiles / OLED_merge.cpp
Created January 31, 2014 19:45
Support for Adafruit_CharacterOLED on the Spark Core. Merge of existing cpp and headers.
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
// OLED hardware versions
#define OLED_V1 0x01
#define OLED_V2 0x02
// commands
#define LCD_CLEARDISPLAY 0x01
@floer32
floer32 / tupperware.py
Last active September 26, 2022 12:13
recursively convert nested dicts to nested namedtuples, giving you something like immutable object literals
from UserDict import IterableUserDict
import collections
__author__ = 'github.com/hangtwenty'
def tupperware(mapping):
""" Convert mappings to 'tupperwares' recursively.
@jiahuang
jiahuang / watchdog.c
Created November 30, 2012 05:55
ATTiny watchdog setting
uint8_t watchdog_count = 0;
ISR(WDT_vect) {
// This vector is for the watchdog timer
PORTA = PORTA | (1 << LED ); // The LED never goes on
++watchdog_count;
}
ISR(PCINT0_vect)
{