This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d917bb927d7a57ff3644dcc61de25b491d4f182e Mon Sep 17 00:00:00 2001 | |
From: jinleileiking <jinleileiking@gmail.com> | |
Date: Thu, 29 Mar 2012 20:36:22 +0200 | |
Subject: [PATCH] add ac plugin | |
--- | |
contrib/README | 8 ++++++++ | |
contrib/ac.lua | 35 +++++++++++++++++++++++++++++++++++ | |
2 files changed, 43 insertions(+) | |
create mode 100644 contrib/ac.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Char | |
alphabet = ['A'..'Z']++['ß','Ä','Ö','Ü'] | |
charToInteger :: Char -> Integer | |
charToInteger char = maybe 0 id isValue | |
where charMap = zip alphabet [0..29] | |
isValue = lookup (toUpper char) charMap | |
integerToChar :: Integer -> Char |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main = print $ (27^7) `mod` 30 == 3 -- True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
// Configure our HTTP server to respond with Hello World to all requests. | |
var server = http.createServer(function (request, response) { | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
response.end("Hello World\n"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From bd419aaee1c3488a8ebfc51093975d978305af6d Mon Sep 17 00:00:00 2001 | |
From: jinleileiking <jinleileiking@gmail.com> | |
Date: Wed, 16 May 2012 18:37:15 +0200 | |
Subject: [PATCH] cpufreq: handle not existing frequency/governer | |
In some cases not all cpu informations will be provided. | |
(ex. in virtual machines) | |
Therefore default to "N/A". | |
--- | |
widgets/cpufreq.lua | 13 ++++++++++--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From e5630c1c1ab083af6dc0a956a35c2e0e609c87bc Mon Sep 17 00:00:00 2001 | |
From: jinleileiking <jinleileiking@gmail.com> | |
Date: Wed, 30 May 2012 17:16:13 +0200 | |
Subject: [PATCH] add wpa widget | |
--- | |
contrib/README | 6 +++++ | |
contrib/wpa.lua | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
2 Dateien geändert, 73 Zeilen hinzugefügt(+) | |
create mode 100644 contrib/wpa.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# EDIT this | |
EMAIL=youremail@example.com | |
PASSWORD=yoursecret | |
DOMAIN=example.dnsd.me | |
IP=`curl --silent http://myip.dnsdynamic.com/` | |
curl --silent --user "$EMAIL:$PASSWORD" -k "https://www.dnsdynamic.org/api/?hostname=$DOMAIN&myip=$IP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rbenv' | |
# Basic settings: | |
# domain - The hostname to SSH to | |
# deploy_to - Path to deploy into | |
# repository - Git repo to clone from (needed by mina/git) | |
# user - Username in the server to SSH to (optional) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
# idea: default profile photos has the Content-Type image/gif | |
# read this: http://stackoverflow.com/questions/5555199 | |
def default_facebook_photo?(facebook_uid) | |
resp = fetch("https://graph.facebook.com/#{facebook_uid}/picture") | |
resp['content-type'] == 'image/gif' | |
end | |
# http head request which follows redirects | |
def fetch(uri, limit = 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash "update virtual box additions" do | |
# http://vagrantup.com/v1/docs/troubleshooting.html | |
code <<-EOS | |
/etc/init.d/vboxadd setup | |
EOS | |
# FIXME only works as long the kernel version doesn't change! | |
#not_if do | |
# # check if vboxsf driver is loaded | |
# `lsmod` =~ /vboxsf/ | |
#end |