Skip to content

Instantly share code, notes, and snippets.

View koenbok's full-sized avatar

Koen Bok koenbok

View GitHub Profile
@koenbok
koenbok / WKWebInspector.m
Created March 13, 2015 10:50
WKWebInspector.m
// https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
@interface WKWebView (WKPrivate)
@property (nonatomic, setter=_setAllowsRemoteInspection:) BOOL _allowsRemoteInspection;
@property (copy, setter=_setCustomUserAgent:) NSString *_customUserAgent;
@end
@interface WKPreferences (WKPrivate)
@property (nonatomic, setter=_setCompositingBordersVisible:) BOOL _compositingBordersVisible;
@property (nonatomic, setter=_setCompositingRepaintCountersVisible:) BOOL _compositingRepaintCountersVisible;
@property (nonatomic, setter=_setTiledScrollingIndicatorVisible:) BOOL _tiledScrollingIndicatorVisible;
@koenbok
koenbok / TabBar.tsx
Created May 15, 2019 18:49
Tab Bar
import * as React from "react"
import { Frame, Stack } from "framer"
function capitalize(name) {
// Capitalizes a word: feed -> Feed
return name.charAt(0).toUpperCase() + name.slice(1)
}
function Button({ title, active, onTap }) {
const opacity = active ? 1 : 0.35
import * as React from "react"
import { Frame, useCycle } from "framer"
export function Button() {
const [variant, next] = useCycle({ scale: 1 }, { scale: 1.5 })
return (
<Frame
animate={variant}
onTap={() => next()}
@koenbok
koenbok / advanced.md
Last active May 5, 2019 14:34
Learn Programming

Advanced Programming

Programming setup

  • Instant visual output.
  • Fast startup time, fast execution.
  • Sensible errors, with code locations.
  • Easy to set up and get working.

Architecture

import * as React from "react";
export class Keyboard extends React.Component {
state = { key: null };
onChange = event => {
this.setState({ key: event.target.value });
};
render() {
@koenbok
koenbok / CustomDevide.coffee
Created October 20, 2014 09:34
Custom Framer Device
Framer.Device.Devices["my-device"] =
name: "My Device"
deviceType: "mobile"
deviceImage: "my-device.png"
deviceImageWidth: 472
deviceImageHeight: 806
screenWidth: 320
screenHeight: 400
<html>
<body>
<video controls autoplay muted>
<source id="mp4" src="http://grochtdreis.de/fuer-jsfiddle/video/sintel_trailer-480.mp4" type="video/mp4">
</video>
</body>
</html>
@koenbok
koenbok / framer-canvas.js
Created October 16, 2013 18:25
Framer Canvas Example
var myCanvasView = new View({
x:100, y:100,
width:200, height:200
})
// Add a nice background color so we see it
myCanvasView.style.backgroundColor = "rgba(255,0,0,.5)"
// This is the tricky bit, we create a canvas element (so we have a reference to it) and insert it into the view
@koenbok
koenbok / gulpfile.coffee
Last active September 29, 2017 05:12
Wercker Git Versions
gulp.task "version", (callback) ->
async.series [
(cb) -> command("git rev-parse --abbrev-ref HEAD", cb) # branch
(cb) -> command("git describe --always --dirty", cb) # hash
(cb) -> command("git rev-list --count HEAD", cb) # build
], (err, results) ->
info =
branch: results[0]
@koenbok
koenbok / bitcoin-wallet-features
Created August 9, 2013 11:30
Coinbase (or any other online bitcoin wallet) feature requests
- A graph of your wallet net worth over time
- An unrealized gains table listing your bitcoin buy prices and the current worth
- Reserve "buckets" in your wallet that can only be touched with a special code
- 3rd party access codes that can only access specific buckets in your wallet