Skip to content

Instantly share code, notes, and snippets.

View tun's full-sized avatar
🌊
learning

Ricardo Tun tun

🌊
learning
View GitHub Profile
@tun
tun / .conkyrc
Created September 13, 2009 07:31
Conky
alignment middle_right
background no
border_width 0
border_margin 10
cpu_avg_samples 2
default_color white
default_outline_color black
default_shade_color white
draw_borders no
draw_graph_borders no
@tun
tun / .conkyrc
Created September 21, 2009 10:13
Conky
alignment middle_left
background no
border_width 0
border_margin 10
cpu_avg_samples 2
default_color white
default_outline_color black
default_shade_color white
draw_borders no
draw_graph_borders no
@tun
tun / wma2mp3.sh
Created January 3, 2010 09:42
Convert wma files to mp3 using ffmpeg & lame
#!/bin/bash
# wma2mp3.sh
# Ricardo Tun <me@ricardotun.net>
#
# Depends: lame, ffmpeg
# Use: ./wma2mp3.sh path_to_wma_files
# If directory is not specified, the current working directory will be used to find wma files.
wma2mp3() {
if [ ! -e *.wma ]; then
@tun
tun / klv.colorscheme
Created October 24, 2012 04:21
A Konsole Colorscheme
[Background]
Color=18,18,18
Transparency=false
[BackgroundIntense]
Color=18,18,18
Transparency=false
[Color0]
Color=27,29,30
@tun
tun / ps1.sh
Created November 2, 2012 02:06
Some of my $PS1
PS1='\[\033[36m\]\u \[\033[30m\]@ \[\033[37m\]\h\[\033[36m\]:\[\033[30m\][\[\033[33m\]\w\[\033[30m\]]\n\[\033[33m\]$ \[\033[00m\]
@tun
tun / solarized_dark.sh
Created November 2, 2012 02:17
Solarized dark colors for gnome-terminal
gconftool-2 --set /apps/gnome-terminal/profiles/Default/foreground_color --type string "#708183"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/background_color --type string "#001E26"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/bold_color --type string "#81908F"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/palette --type string "#002731:#D01B24:#728905:#A57705:#2075C7:#C61B6E:#259185:#E9E2CB:#001E26:#BD3612:#465A61:#52676F:#708183:#5856B9:#81908F:#FCF4DC"
$(function(){
$('nav#main a, nav#foo a').click(function(){
var where = $(this).attr('href')
if ( where == '#top') {
var slideto = '0'
} else {
var slideto = $(where).offset().top
}
@tun
tun / year_availability_no_sundays.sql
Created February 7, 2013 23:41
Set availability for a full year, except sundays
DECLARE @start_date DATETIME, @end_date DATETIME
SET @start_date = '2014-01-01'
SET @end_date = '2014-12-31'
WHILE @start_date <= @end_date
BEGIN
--PRINT @start_date
IF datepart(weekday, @start_date) = 1
INSERT INTO tblAvailability(avDate, avNumber) VALUES(@start_date, 0)
ELSE
INSERT INTO tblAvailability(avDate, avNumber) VALUES(@start_date, 120)
@tun
tun / random_string.py
Created September 13, 2013 05:10
Generates random string
# -*- coding: utf-8 -*-
import string
import random
def random_string(size=6):
chars = (string.ascii_uppercase + string.ascii_lowercase + string.digits)
return ''.join(random.choice(chars) for x in range(size))
@tun
tun / list_stored_procedures.sql
Last active December 31, 2015 21:49
List all stored procedures in a MS SQL database
SELECT ROUTINE_NAME, ROUTINE_DEFINITION, CREATED, LAST_ALTERED
FROM information_schema.routines
WHERE ROUTINE_TYPE = 'PROCEDURE'
ORDER BY ROUTINE_NAME ASC