Skip to content

Instantly share code, notes, and snippets.

View encrypt94's full-sized avatar

encrypt encrypt94

View GitHub Profile
@encrypt94
encrypt94 / wavegen.rb
Created August 17, 2015 20:19
Morse traffic to soundwave
#!/usr/bin/env ruby
# WTFPL
require 'wavefile'
TWO_PI = 2 * Math::PI
SAMPLE_RATE = 44100
timestamps = []
time_zero=nil
@encrypt94
encrypt94 / morse.rb
Created August 17, 2015 20:16
ascii2morse and viceversa
#!/bin/env ruby
# WTFPL
code = {
'A' => '.-', 'N' => '-.', '0' => '-----',
'B' => '-...', 'O' => '---', '1' => '.----',
'C' => '-.-.', 'P' => '.--.', '2' => '..---',
'D' => '-..', 'Q' => '--.-', '3' => '...--',
'E' => '.', 'R' => '.-.', '4' => '....-',
'F' => '..-.', 'S' => '...', '5' => '.....',
'G' => '--.', 'T' => '-', '6' => '-....',
@encrypt94
encrypt94 / no-icons-every-fucking-time.patch
Created April 14, 2015 21:02
quick fix to remove unwanted default icons in dunst
--- a/notification.c
+++ b/notification.c
@@ -443,11 +443,11 @@ int notification_init(notification * n, int id)
n->start = 0;
if (n->icon == NULL) {
- n->icon = strdup(settings.icons[n->urgency]);
- }
- else if (strlen(n->icon) <= 0) {
- free(n->icon);
@encrypt94
encrypt94 / add-tracker-links.js
Last active August 29, 2015 14:19
ebay-seller-userscripts
@encrypt94
encrypt94 / android-screenshot.rb
Created October 18, 2014 14:30
Simple android remote screenshot tool with ruby-adb-sdklib and chunky_png
require 'adb-sdklib'
require 'chunky_png'
adb = AdbSdkLib::Adb.new
device = adb.devices.first
screen = device.screenshot
image = ChunkyPNG::Image.new(screen.width, screen.height, ChunkyPNG::Color::TRANSPARENT)
screen.each_pixel do |p|
image[p.x,p.y] = ChunkyPNG::Color.rgba(p.red, p.green, p.blue, p.alpha)