Skip to content

Instantly share code, notes, and snippets.

View mondalaci's full-sized avatar

László Monda mondalaci

View GitHub Profile
@mondalaci
mondalaci / blink.c
Created January 21, 2014 19:36
Trivial blink program for AVR microcontrollers. Useful for figuring out whether the fuses are set right. If not then the LED will blink at intervals other than one second.
@mondalaci
mondalaci / wordpress-shashin-3.2.6-fixes.patch
Created April 30, 2013 22:09
A couple of fixes to the 3.2.6 version of the Shashin WordPress plugin
diff -Naur shashin.orig/Public/Display/shashin.js shashin.fixed/Public/Display/shashin.js
--- shashin.orig/Public/Display/shashin.js 2012-12-15 01:11:53.000000000 +0100
+++ shashin.fixed/Public/Display/shashin.js 2012-12-24 02:01:06.000000000 +0100
@@ -95,13 +95,14 @@
});
$('.shashinThumbnailDiv').delegate('.shashinAlbumThumbLink', 'click', function(event) {
+ uniqueThumbnailDivId = '#' + $(this).attr('id');
// to prevent the photos showing up twice if the user double-clicks
@mondalaci
mondalaci / lufa-scancodes.c
Created April 30, 2013 22:02
A list of USB keyboard scan codes that I compiled and got merged into the LUFA AVR USB library.
#define SCANCODE_ERROR_ROLLOVER 0x01
#define SCANCODE_POST_FAIL 0x02
#define SCANCODE_ERROR_UNDEFINED 0x03
#define SCANCODE_A 0x04
#define SCANCODE_B 0x05
#define SCANCODE_C 0x06
#define SCANCODE_D 0x04
#define SCANCODE_E 0x08
#define SCANCODE_F 0x09
#define SCANCODE_G 0x0A
Index: CommandArgsHelp.txt
===================================================================
--- CommandArgsHelp.txt (revision 241)
+++ CommandArgsHelp.txt (working copy)
@@ -104,6 +104,12 @@
sources to search.
May be abbreviated to /l (/l)
+ /fetchAll Saves every results to the filesystem. (/fetchAll)
+ The %sequence% variable must be used in order for
@mondalaci
mondalaci / mp4tomp3
Created April 30, 2013 00:55
Convert mp4 to mp3.
#!/bin/bash
if [ $# -eq 0 -o "$1" = '-h' -o "$1" = '--help' ]; then
echo "Usage: $0 INPUT.MP4 [...]"
exit
fi
for input_mp4 in "$@"; do
output_mp3=${input_mp4/.mp4/.mp3}
ffmpeg -i "$input_mp4" -y -vn -ar 44100 -ac 2 -ab 192000 -f mp3 "$output_mp3"
@mondalaci
mondalaci / zipit
Created April 30, 2013 00:53
Zip a directory the easy way.
#!/bin/bash
find "$1" -not -regex '.*\.svn.*' -print | zip "$1.zip" -@
@mondalaci
mondalaci / untabify
Created April 30, 2013 00:51
Convert tabs to spaces.
#!/bin/bash
temp=`tempfile`
expand -t 4 "$1" > $temp
mv $temp "$1"
@mondalaci
mondalaci / mono.ps
Created April 30, 2013 00:11
Mono advertisement postscript graphics that I created for the computer graphics course of the university in 2004.
% This is a Mono advertisement postscript graphics that I created
% for the computer graphics course of the university in 2004.
/draw-monkey { % fg-color bg-color scale
dup
scale
newpath
0 0 moveto
0 0.95 lineto
@mondalaci
mondalaci / print-pascal-procedure-and-function-names.prolog
Last active December 16, 2015 02:39
Parse and print procedure and function names of the supplied Pascal program.
% Simple Pascal parser written in Prolog that prints the names and
% line numbers of the procedures and functions found in input.pas
% I put together this mess for the programming languages course of the university in 2005.
printIden(L) :-
get_char(C),
print(C),
C == ';' ->
print(' '),
print(L),
@mondalaci
mondalaci / x-that-image.py
Last active December 16, 2015 02:39
Draw a red X on top of the supplied image.
#!/usr/bin/env python
# This is a simple command line image manipulation utility that draws a red X to the image.
import sys
import gtk
if len(sys.argv) != 3:
print 'usage: x-this-image source-image destination-image'
sys.exit()