Skip to content

Instantly share code, notes, and snippets.

View koenpunt's full-sized avatar
:octocat:
...

Koen Punt koenpunt

:octocat:
...
View GitHub Profile
@koenpunt
koenpunt / chosen-bootstrap.css
Last active March 11, 2023 01:01
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@koenpunt
koenpunt / permit_recursive_params.out
Last active August 26, 2021 06:46
ActionController::Parameters -> permit_recursive_params
{"tree"=>
{"name"=>"Australia",
"value"=>39904,
"id"=>6,
"description"=>"",
"string_array"=>["one", "two"],
"array_with_hashes"=>[{"a"=>"1"}, {"a"=>"2"}],
"type"=>{"name"=>"Other", "icon"=>"<i class=\"fa fa-pagelines\"></i>"},
"children"=>
[{"name"=>"Boxes",
<?php
function gfm($text){
# Extract pre blocks
$extractions = array();
$text = preg_replace_callback('/<pre>.*?<\/pre>/s', function($matches) use (&$extractions){
$match = $matches[0];
$md5 = md5($match);
$extractions[$md5] = $match;
@koenpunt
koenpunt / node-14.16.0.patch
Last active April 29, 2021 01:39
Node 14.16.0 patch to support WASM on ARM64 Macs, based on the changes here: https://github.com/nodejs/node/pull/35986
From 42fdc91e497cc1fc7380b1bfd14216802ed4c63c Mon Sep 17 00:00:00 2001
From: Koen Punt <koen@koenpunt.nl>
Date: Tue, 16 Mar 2021 11:10:48 +0100
Subject: [PATCH] patch
---
common.gypi | 2 +-
deps/v8/BUILD.gn | 1 +
deps/v8/include/v8-platform.h | 8 ++-
deps/v8/src/base/page-allocator.cc | 14 ++++
@koenpunt
koenpunt / Composition.jsx
Last active January 6, 2019 11:37
React composition for inheritance
const MyText = ({ style, ...props }) => (
<Text style={[styles.myText, style]} {...props} />
);
const LargerText = ({ style, ...props }) => (
<MyText style={[styles.largerText, style]} {...props} />
);
const styles = StyleSheet.create({
myText: {
#!/bin/bash
# $Id: ldap_ssh_key.sh 138 2013-09-14 08:24:39Z jmorano $
#
# Check if the user is in the right group
# and afterwards retrieve the SSH public key from LDAP
# Logs directly in Syslog
#
#
# sshd_config for OpenSSH 6.2 or higher:
#
@koenpunt
koenpunt / README.md
Last active July 1, 2017 13:01
UIRefreshControl override so that app correctly idles while UI testing Raw

UIRefreshControl+Testing

Follow up on https://gist.github.com/koenpunt/cf8130bdfc432d31136b, but since method swizzling apparently doesn't work so well with Swift 3 anymore, I've now created it as Obj-C protocol.

When using in a Swift project, add it to the bridging header:

#import "UIRefreshControl+Testing.h"
@koenpunt
koenpunt / # phpsh - 2016-12-22_19-04-31.txt
Created December 22, 2016 18:17
phpsh (homebrew/php/phpsh) on macOS 10.12.2 - Homebrew build logs
Homebrew build logs for homebrew/php/phpsh on macOS 10.12.2
Build date: 2016-12-22 19:04:31

Keybase proof

I hereby claim:

  • I am koenpunt on github.
  • I am koenpunt (https://keybase.io/koenpunt) on keybase.
  • I have a public key whose fingerprint is 26D3 50B3 B5D9 FBC2 CCDD 705F 37DB 22F4 1F0F C235

To claim this, I am signing this object:

@koenpunt
koenpunt / README.md
Last active May 2, 2016 16:47
UIRefreshControl override so that app correctly idles while UI testing

UIRefreshControl+testing.swift

You'll need to a -DTESTING compile flag to the configuration you use for testing to enable this extension only for test builds.

Imgur