Skip to content

Instantly share code, notes, and snippets.

Avatar

Bèr Kessels berkes

View GitHub Profile
View query_wtf.sql
SELECT DISTINCT SUBPATH(categories.path, 0, 1) FROM "gauges" INNER JOIN "entities" ON "entities"."id" = "gauges"."entity_id" INNER JOIN "categories_gauges" ON "categories_gauges"."gauge_id" = "gauges"."id" INNER JOIN "categories" ON "categories"."id" = "categories_gauges"."category_id" WHERE (entities.path <@ '1924544') AND (gauges.id IN (SELECT "gauges"."id" FROM "gauges" LEFT OUTER JOIN categories_gauges
ON categories_gauges.gauge_id = gauges.id
AND categories_gauges.category_id IN (SELECT "categories"."id" FROM "categories" WHERE (categories.path <@ '5005')) WHERE (categories_gauges.category_id IN (5129,2496,2500,2504,2509,2513,2517,2521,2525,2529,8012,8015,4274,4318,4556,4322,3124,3203,3089,3081,3091,3123,3093,3059,3067,3055,3075,3125,3133,3108,3113,3114,3116,3119,3118,3129,3100,3670,3663,3700,4044,4020,4030,4011,4050,3094,3101,3194,3196,3197,3103,3038,6610,5007,5008,5006,7578,7581,7795,7802,7810,7817,7820,7824,7827,7830,7833,7836,7841,7814,7805,8933,8977,9706,9303,9323,9456,9063,9073,9076,962
View password.rb
#!/usr/bin/ruby
# English:
# file = "/usr/share/dict/british-english"
# file = /usr/share/dict/words
file = "/usr/share/dict/nederlands"
words = File.read(file).split("\n")
16.times do
View scheldwoorden.rb
require 'pp'
prefixes = %w{
rot
graf
plak
vuil
prut
pluis
}
@berkes
berkes / command
Last active Mar 6, 2020
Dutch Domains in The Duckduckgo Tracker Radar Dataset
View command
git clone https://github.com/duckduckgo/tracker-radar
cd tracker-radar
grep -R "\"domain\":" | grep "\.nl\"" | cut -d ":" -f3- | sed "s/[ \"\,]//g"
@berkes
berkes / CouponManager.sol
Created Nov 26, 2018
CouponManager v0.1.0
View CouponManager.sol
pragma solidity ^0.4.22;
contract CouponManager {
enum Answers { NoAnswer, Approved, Denied, Pending }
struct Batch {
string description;
uint expiresAt;
uint24 amount;
uint24 free;
@berkes
berkes / gist:d163f8d1d008e9167fd10e1fa3a4b93b
Created Oct 24, 2017
ethereum faucet proof of access
View gist:d163f8d1d008e9167fd10e1fa3a4b93b
0x88236B99814cc5374048120199473C8C62805eB4
View keybase.md

Keybase proof

I hereby claim:

  • I am berkes on github.
  • I am berkes (https://keybase.io/berkes) on keybase.
  • I have a public key whose fingerprint is 31D5 9C42 A7BB 5038 CCC3 0C43 3A10 7C51 9147 23F8

To claim this, I am signing this object:

View fifo_hash.rb
require "pp"
require "benchmark"
# Yea. Extremely slow and prolly Linux only
def mem_sampler
stat = GC.stat
stat.map do |k,v|
"#{k}\t#{v}"
end.join("\n")
end
@berkes
berkes / log-git-flow-feature
Created Apr 6, 2016
Time logging with git flow
View log-git-flow-feature
set -e
working_dir=$(pwd)
feature=$2
action=$1
now=$(date -u +"%Y-%m-%dT%H:%M:%SZ") # ISO8601
echo "[$now] $working_dir $action $feature" >> ~/.git-flow-feature.log
View deler.sh
number=$1
prime=true
#for i in {1.."$number"}
for i in $(seq 2 1 $(($number - 1)))
do
if [ $(($number % $i)) -eq 0 ]
then
prime=false
out="$out \n number $i a factor"
fi
You can’t perform that action at this time.