Skip to content

Instantly share code, notes, and snippets.

View testman42's full-sized avatar
:octocat:
Converting caffeine into code

testman42

:octocat:
Converting caffeine into code
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@gvx
gvx / mastermind.py
Created May 16, 2011 20:20
An implementation of Knuth's five-guess algorithm to solve a mastermind code [CC0]
from itertools import product
def score(self, other):
first = len([speg for speg, opeg in zip(self, other) if speg == opeg])
return first, sum([min(self.count(j), other.count(j)) for j in 'ABCDEF']) - first
possible = [''.join(p) for p in product('ABCDEF', repeat=4)]
results = [(right, wrong) for right in range(5) for wrong in range(5 - right) if not (right == 3 and wrong == 1)]
def solve(scorefun):
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@blackbfm-zz
blackbfm-zz / sendfreesms.php
Last active May 25, 2018 14:49
Skripta za pošiljanje sms preko Simobilove Klape / Najdi.si / Tusmobil
<?php
//=========================================================================
// Skripta za posiljanje sms preko Simobilove Klape / Najdi.si / Tusmobil
// Verzija 2.50 (c) blackbfm @ slo-tech
//=========================================================================
// Pošiljanje:
// SendFreeSms("ponudnik", "uporabniskoime", "geslo", "stevilka", "sporocilo")
//
// Preverjanje stanja:
// SendFreeSms("ponudnik", "uporabniskoime", "geslo", "stevilka", "sporocilo", False)
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 31, 2024 22:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tatic0
tatic0 / README
Created September 8, 2012 13:44
progress bar using zenity
zenity example
@daleobrien
daleobrien / ncurses_stl.cpp
Created November 18, 2013 21:19
A general purpose example of using ncurses in C++ e.g. with STL strings. Note: copied from http://pastebin.com/jRK9C129
/* ncurses C++
*
* A general purpose example of using ncurses in C++ e.g. with STL strings.
* I guess whatever license ncurses uses applies, otherwise public domain.
*/
# include <algorithm>
# include <iostream>
# include <fstream>
# include <iterator>
@baderj
baderj / twitch_past_broadcast_downloader.py
Last active March 5, 2023 21:43
script to download past broadcasts from twitch.tv
import requests
import sys
import json
import re
import os
import string
import argparse
BASE_URL = 'https://api.twitch.tv'
@mitsuji
mitsuji / create_vm.sh
Created January 13, 2014 10:24
VirtualBox create vm shell script
#!/bin/sh
# ./create_vm.sh vm1 Debian_64 1024 20000 3393 Downloads/debian-7.1.0-amd64-netinst.iso
# VBoxManage startvm vm1 -type headless
# VBoxManage unregistervm vm1 --delete
VM_NAME=$1
OS_TYPE=$2
MEMORY_SIZE=$3