Skip to content

Instantly share code, notes, and snippets.

View clauswitt's full-sized avatar

Claus Witt clauswitt

View GitHub Profile
@clauswitt
clauswitt / reddit-likes.js
Created May 13, 2014 08:20
Quick append a tags for reddit likes to specific node
function appendUserRedditLikesToNode(username, node) {
$.getJSON('http://www.reddit.com/user/'+username+'/liked.json?jsonp=?&limit=10', {}, function(data) {
var atags = data.data.children.map(
function(item) {
return $('<a href="'+item.data.url+'">'+item.data.title+'</a>');
}
);
$(node).append(atags);
}
);
@clauswitt
clauswitt / keybase.md
Created May 9, 2014 20:49
keybase.md

Keybase proof

I hereby claim:

  • I am clauswitt on github.
  • I am clauswitt (https://keybase.io/clauswitt) on keybase.
  • I have a public key whose fingerprint is 8E47 C47B 1788 B69B 9D87 A8AD 8624 6833 2B6D B274

To claim this, I am signing this object:

@clauswitt
clauswitt / test.asm
Created March 26, 2014 13:08
quick assembly program
section .text
global mystart
mystart:
push dword mymsg
push dword 1
mov eax, 0x4
sub esp, 4
int 0x80
@clauswitt
clauswitt / LICENSE
Created February 5, 2014 10:36 — forked from joerayme/LICENSE
Copyright (c) 2013 Couller Ltd. and Joseph Ray
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
## mysql::master
ruby_block "store_mysql_master_status" do
block do
node.set[:mysql][:master] = true
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password])
m.query("show master status") do |row|
row.each_hash do |h|
node.set[:mysql][:master_file] = h['File']
node.set[:mysql][:master_position] = h['Position']
end
@clauswitt
clauswitt / Rakefile
Created December 17, 2013 08:47
Various files for our chef server setup
#
# Rakefile for Chef Server Repository
#
# Author:: Adam Jacob (<adam@opscode.com>)
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
activate :deploy do |deploy|
deploy.build_before = true
deploy.method = :rsync
deploy.host = "hostname.com"
deploy.path = "/opt/sites/hostname.com"
deploy.user = "deploy"
end
{
"run_list": [
"role[hostname-setup]"
]
}
server {
listen 80;
server_name sitename.com;
access_log /var/log/nginx/sitename.access.log;
root /opt/sites/sitename.com;
index index.html index.htm;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf)$ {
expires max;
access_log off;
directory "/opt/sites" do
owner "deploy"
group "deploy"
mode 00755
action :create
end
directory "/opt/sites/sitename.com" do
owner "deploy"
group "deploy"