Skip to content

Instantly share code, notes, and snippets.

View hdznrrd's full-sized avatar
🙄

Gregor Jehle hdznrrd

🙄
  • Wartenberg, Germany
View GitHub Profile
@hdznrrd
hdznrrd / A9.c
Created January 27, 2012 12:54 — forked from lumaxis/A9.c
Mittelwert beliebig vieler Zahlen
#include "stdio.h"
#include "stdlib.h"
void inputNumbers(int *size, double **numbers)
{
// Abfrage nach Anzahl der Zahlen
printf("Anzahl der zu speichernden Zahlen:\n");
scanf("%d", size);
// Entsprechende Menge Speicher reservieren
@hdznrrd
hdznrrd / gist:1151189
Created August 17, 2011 09:31
disable localized exception error message
CultureInfo c = new CultureInfo("en-US");
// make formatting of output adhere to culture (eg. number format)
Thread.CurrentThread.CurrentCulture = cult;
// force exceptions to be displayed localized to selected culture
Thread.CurrentThread.CurrentUICulture = cult;
@hdznrrd
hdznrrd / sort.sh
Created August 7, 2011 15:21
sort .NEF files into dated folders
#!/bin/bash
# for all Nikon raw files in thhe folder
for file in *.NEF; do
# get create date of file
date=$(stat -c %y "$file" | awk '{print $1}')
# if there's no folder with this date yet, create one
if [[ ! -d "$date" ]]; then
mkdir "$date"
@hdznrrd
hdznrrd / make_awesome.sh
Created July 12, 2011 08:24
pounding ubuntu into working with awesome and some gnome features like panel
#!/bin/sh
# pounding ubuntu into working with awesome and some gnome features like panel
gconftool-2 --type string --set /desktop/gnome/session/required_components/windowmanager awesome
cd ~
rm -f ~/.xsession ~/.xinitrc
echo '#!/bin/sh' > .xinitrc
echo -e "gnome-settings-daemon &\ngnome-panel &\nnm-applet &\npidgin &\ngnome-volume-manager &\nexec awesome" >> .xinitrc
ln -s .xinitrc .xsession
echo -e "[Desktop Entry]\nVersion=1.0\nType=Application\nName=Awesome\nComment=The awesome launcher!\nTryExec=awesome\nExec=awesome" > ~/.local/share/applications/awesome.desktop
sudo echo -e "[Desktop Entry]\nName=Xsession\nComment=Xsession for awesome\nExec=/etc/X11/Xsession\nX-Ubuntu-Gettext-Domain=gdm" > /usr/share/xsessions/xsession.desktop
@hdznrrd
hdznrrd / gist:656996
Created October 31, 2010 19:03
HSV to RGB (Arduino)
void HSV_to_RGB(float h, float s, float v, byte *r, byte *g, byte *b)
{
int i,f,p,q,t;
h = max(0.0, min(360.0, h));
s = max(0.0, min(100.0, s));
v = max(0.0, min(100.0, v));
s /= 100;
v /= 100;
@hdznrrd
hdznrrd / mkthumbs.sh
Created October 26, 2010 07:55
create thumbnails
mkdir thumb && ls *jpg | xargs -I{} -n1 convert -resize 10% "{}" "thumb/{}"