Skip to content

Instantly share code, notes, and snippets.

View gr4y's full-sized avatar

Sascha Wessel gr4y

View GitHub Profile
@gr4y
gr4y / gist:5517010
Created May 4, 2013 09:53
How I setup my ruby environment:
#
# This is the way I configured my ruby environment on ArchLinux.
#
# I don't like the overhead of rvm, so I use chruby to switch between ruby versions.
# So first you need to install chruby from source:
#
# https://github.com/postmodern/chruby#install
#
# To build ruby from source I use ruby-build, so after chruby we install ruby-build:
#
@gr4y
gr4y / kasa-dashboard.json
Created June 21, 2021 19:46
TP-Link Kasa Grafana Dashboard
// TP-Link Kasa Dashboard
// based on https://grafana.com/grafana/dashboards/10957, but slightly modified
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
@gr4y
gr4y / example.md
Last active February 11, 2018 10:46
Liquid-Tag for embedding Instagram into your Jekyll Posts
@gr4y
gr4y / wemo.go
Last active September 25, 2017 17:58
Toggle all WeMo switches. If it is on, it will turn off. If it is off, it will turn on. Just a quick little thing.
package main
import (
"fmt"
"github.com/huin/goupnp"
"github.com/huin/goupnp/soap"
)
func main() {
devices, err := goupnp.DiscoverDevices("urn:Belkin:device:controllee")
@gr4y
gr4y / style.css
Last active June 16, 2017 17:48
A User Style for twitter.com to make the profile images and buttons less round
.Avatar, .avatar,
.DashboardProfileCard-avatarImage,
.DashboardProfileCard-avatarLink,
.MomentUserByline-avatar,
.ProfileAvatar,
.ProfileAvatar-image,
.ProfileAvatar-placeholderImage,
.ProfileAvatarEditing,
.ProfileAvatarEditing-button,
.ProfileAvatarEditing-overlay,
@gr4y
gr4y / gist:2387672
Created April 14, 2012 20:05
allow only numbers in UITextField. For now without currency!
- (BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSCharacterSet *nonNumberSet = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789."] invertedSet];
BOOL result = NO;
if([string length] == 0){ //backspace
result = YES;
}
else{
@gr4y
gr4y / http_serve_stop.go
Created January 22, 2016 10:51
Stopping an http.Server via channel. I want to use this for OAuth2 in an command line application, I don't want to be an web application.
package main
import (
"fmt"
"net"
"net/http"
// "os"
)
func main() {
task :deploy do
sh "rsync -rt _site #{USER}@#{SERVER}:~/blog"
end
@gr4y
gr4y / .slate
Created October 27, 2013 15:29
my configuration file for the slate window manager
# Parts of this config is borrowed from
# https://gist.github.com/lmullen/4736568
# GLOBAL CONFIGURATIONS
# -------------------------------------------------------------------
# See https://github.com/jigish/slate/wiki/Global-Configs
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
@gr4y
gr4y / dabblet.css
Created February 21, 2013 22:18
Pretty CSS "Stiched" look
/**
* Pretty CSS "Stiched" look
* inspired by http://css-tricks.com/snippets/css/stitched-look/
*/
body {
margin: 0;
}
.text {