Skip to content

Instantly share code, notes, and snippets.

View timoschilling's full-sized avatar
👻
yolo

Timo Schilling timoschilling

👻
yolo
View GitHub Profile
@timoschilling
timoschilling / benchmark_except.rb
Last active April 18, 2021 10:35
Benchmark Hash#except
require 'benchmark/ips'
require 'active_support/hash_with_indifferent_access'
require 'active_support/core_ext/hash'
class Hash
def except_new(*keys)
slice(*(self.keys - keys))
end
end
CustomResponseHeader:
Type: AWS::Serverless::Function
Properties:
# FunctionName: !Sub ${AWS::StackName}-CustomResponseHeader
Handler: index.handler
Runtime: nodejs12.x
AutoPublishAlias: live
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
@timoschilling
timoschilling / 1.md
Created January 15, 2020 12:19
API Gateway use cases

API Gateway use cases

package main
import (
"strconv"
"github.com/brutella/hc"
"github.com/brutella/hc/log"
"github.com/brutella/hc/accessory"
)
type Bridge struct {
@timoschilling
timoschilling / client.sh
Created October 14, 2013 14:18
self made ical client/server ;)
telnet 127.0.0.1 1234
@timoschilling
timoschilling / mac.txt
Created April 17, 2013 15:50
set different mac address
sudo ifconfig en1 ether 60:33:4b:0b:50:0e
ifconfig en1 | grep ether
@timoschilling
timoschilling / hlink.rb
Created April 8, 2013 13:54
ruby script to create recrosive hardlinks of files with directory structure
#!/bin/sh
#
# Lives in .git/hooks.
# To enable this hook, rename this file to "pre-commit".
# Redirect output to stderr.
exec 1>&2
# works, but is slow. try with ack!
# LANG=C find . -name '*_spec.rb' | xargs egrep -q '^\s*(describe|it|context)\b.*focus'
class D
def macro
:referenced_in
end
def foreign_key
"listimage_asset_id"
end
def eager_load ids
@timoschilling
timoschilling / fizzbuzz.html
Created November 24, 2015 11:52 — forked from moonglum/fizzbuzz.html
This is a FizzBuzz Solution I found on Twitter. It was always shared as a screenshot, so I typed it myself, to try it out ;) Source: https://twitter.com/ericwastl/status/667567483432402944
<html>
<head>
<style>
body {
counter-reset: n;
}
div:before {
counter-increment: n;
content: counter(n);
}