Skip to content

Instantly share code, notes, and snippets.

View kdwinter's full-sized avatar

Kenneth De Winter kdwinter

  • Belgium
  • 02:04 (UTC +02:00)
View GitHub Profile
# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst
# DEVICE NAME CONVERSIONS
#
# Linux Grub
# -------------------------
# /dev/fd0 (fd0)
# /dev/hda (hd0)
# /dev/hdb2 (hd1,1)
$! # The exception information message set by 'raise'.
$@ # Array of backtrace of the last exception thrown.
$& # The string matched by the last successful match.
$` # The string to the left of the last successful match.
$' # The string to the right of the last successful match.
$+ # The highest group matched by the last successful match.
$1 # The Nth group of the last successful match. May be > 1.
$~ # The information about the last match in the current scope.
$= # The flag for case insensitive, nil by default.
$/ # The input record separator, newline by default.
xauth: creating new authority file /home/gig/.serverauth.13200
X.Org X Server 1.6.0
Release Date: 2009-2-25
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.28-ARCH i686
Current Operating System: Linux gigNote 2.6.28-ARCH #1 SMP PREEMPT Sun Mar 8 10:18:28 UTC 2009 i686
Build Date: 02 March 2009 06:09:25PM
url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=#{URI.encode(query)}&rsz=large"
data = Net::HTTP.get_response(URI.parse(url)).body
result = JSON.parse(data)['responseData']['results'].map {|x| x['unescapedUrl']}.first
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../lib/rules'
class ParseError < RuntimeError; end
module Parser
extend self
def is_valid_rule?(str)
$valid_rules.each do |key, regex|
return true if str.match(regex)
-------------------------------------------------------------------------------------
--{{{ Imports
-- Load default libraries
require("awful")
require("beautiful")
-- Naughty
require("naughty")
--}}}
#!/usr/bin/env ruby19
# encoding: utf-8
=begin
Author: Gigamo <gigamo@gmail.com>
Inspired by Todo.txt (http://www.todotxt.com)
Usage: rudo <action> [<action arguments>]
#!/usr/bin/env ruby19
# encoding: utf-8
=begin
Author: Gigamo <gigamo@gmail.com>
Inspired by Todo.txt (http://www.todotxt.com)
Usage: rudo <action> [<action arguments>]
#!/usr/bin/env ruby19
@paclist = `pacman -Qqe | grep -v "$(pacman -Qmp)"`
@listfile = ENV['HOME'] + '/abs/paclist.txt'
File.open(@listfile, 'w+') do |f|
f.puts f.atime
f.puts
f.puts @paclist
end
require 'rubygems'
require 'json'
require 'net/http'
def google(query, service='web', optargs='')
url = "http://ajax.googleapis.com/ajax/services/search/#{service}?v=1.0&q=#{URI.encode(query)}&rsz=large" + optargs
data = Net::HTTP.get_response(URI.parse(url)).body
result = JSON.parse(data)['responseData']['results'].map {|x| x['unescapedUrl']}.first
end