Skip to content

Instantly share code, notes, and snippets.

View TeddyDD's full-sized avatar

Daniel Lewan TeddyDD

View GitHub Profile
@TeddyDD
TeddyDD / dir.pl
Created February 1, 2014 23:03
Get currently runing script directory in Perl
use strict;
use warnings;
use File::Spec;
use File::Basename;
#return current scipt directory
sub get_current_dir {
my $dir = dirname(File::Spec->rel2abs(__FILE__));
}
@TeddyDD
TeddyDD / scupdate.pl
Created March 7, 2014 21:30
Updates the KSP science file to a social versions.
#!/usr/bin/perl
# scupdate 2
#by TeddyDD
#License: MIT: http://opensource.org/licenses/MIT
# Remember to check patch to ksp folder!!!!
use strict;
use warnings;
def sha1OfFile(filepath):
import hashlib
with open(filepath, 'rb') as f:
return hashlib.sha1(f.read()).hexdigest()
@TeddyDD
TeddyDD / diff.py
Created April 24, 2015 18:29
diff for meld
#!/usr/bin/python
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
@TeddyDD
TeddyDD / input_states.gd
Created April 29, 2015 21:25
input states godot
### class for input handling. Returns 4 button states
var input_name
var prev_state
var current_state
var input
var output_state
var state_old
var semaphore = false
\documentclass[12pt,a4paper]{mwart}
\usepackage[utf8]{inputenc}
\usepackage{polski}
\usepackage[stretch=10]{microtype}
\usepackage[margin=3cm]{geometry}
\linespread{1.5}
\usepackage{lmodern}
\begin{document}
-- Boost version: 1.60.0
-- Found the following Boost libraries:
-- chrono
-- date_time
-- filesystem
-- regex
-- signals
-- system
-- thread
-- log
@TeddyDD
TeddyDD / jap.java
Created January 11, 2018 20:18
processing sketch with japaneese-like charachters
int grid = 24;
void setup() {
size(1600, 900);
frameRate(0.3);
//noLoop();
}
void draw_letter(int strokes, float size, float x, float y) {
for (int p = 0; p < strokes; p++) {
@TeddyDD
TeddyDD / mozyt.cr
Last active September 4, 2018 11:43
most viewed yt wideos from firefox history
#!/usr/bin/env crun
# ---
# sqlite3:
# github: crystal-lang/crystal-sqlite3
# ...
# Lists most visited youtube wideos from Firefox history
# Example: Backup videos watched > 10 times
# youtube-dl $(mozyt.cr -p ~/.mozilla/firefox/PROFILEID.default/)
require "option_parser"
@TeddyDD
TeddyDD / plug.kak
Created September 2, 2018 10:41
plugin manager for Kakoune
define-command plug -params 1..2 %{
%sh{
plugdir="/$HOME/.config/kak/src"
[ -d $plugdir ] || mkdir -p "$plugdir"
repo=$(basename $1)
if [ ! -d "$plugdir/$repo" ]; then
git clone "https://github.com/$1" "$plugdir/$repo"
fi
if [ ! -z "$2" ]; then