Skip to content

Instantly share code, notes, and snippets.

View terkelg's full-sized avatar
🔵
Git'n stuff done

Terkel terkelg

🔵
Git'n stuff done
View GitHub Profile
@mattdesl
mattdesl / frag.vert
Created May 17, 2016 21:25
shadow on transparent plane ThreeJS r76
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
varying vec3 vLightFront;
#ifdef DOUBLE_SIDED
varying vec3 vLightBack;
@mattdesl
mattdesl / stripe.glsl
Created November 8, 2016 15:14
stripe effect with noise
uniform vec4 offsetRepeat; // from ThreeJS Texture
uniform float time;
#pragma glslify: noise = require('glsl-noise/simplex/2d');
float pattern(float v, float repeats, float threshold) {
float result = mod(v * repeats, 1.0);
return step(threshold, result);
}
void main () {
@bendc
bendc / iterable.js
Created January 26, 2016 09:09
Make objects iterable
const iterable = function* (obj) {
yield* Object.keys(obj).map(key => [key, obj[key]]);
};
@bendc
bendc / raf-delay.js
Created August 28, 2017 13:19
rAF tutorial: better setTimeout
const delay = (callback, duration) => {
const tick = () =>
getProgress(time) < 1 ? requestAnimationFrame(tick) : callback();
const time = {
duration,
id: requestAnimationFrame(tick)
};
};
@frimik
frimik / git-submodule-sync.rb
Created March 9, 2013 19:32
Make damn sure that git submodule sync is going to work.
#! /usr/bin/env ruby
submods = Hash.new
%x{git config -f .gitmodules --get-regexp '^submodule\..*\.(path|url)$'}.lines.each do |l|
submodule, key, value = l.match(/^submodule\.(.*)\.(path|url)\s+(.*)$/)[1..3]
submods[submodule] = Hash.new unless submods[submodule].is_a?(Hash)
submods[submodule][key] = value
end
@developit
developit / hydra-alias.md
Last active February 27, 2020 01:54
Alias to invoke Chrome Canary w/ tracing, for IRHydra

An Alias to run Chrome with tracing enabled

For Chrome Canary:

alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'

For regular ol' Chrome:

@WebReflection
WebReflection / certificate.sh
Last active July 1, 2020 18:08
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@aemkei
aemkei / LICENSE.txt
Created October 27, 2011 17:16 — forked from 140bytes/LICENSE.txt
Lorenz Attractor - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@sanzaru
sanzaru / CollapsibleDemoView.swift
Last active August 19, 2020 12:48
Demo view for collapsible view
import SwiftUI
struct CollapsibleDemoView: View {
var body: some View {
VStack(spacing: 10) {
HStack {
Text("Here we have some fancy text content. Could be whatever you imagine.")
Spacer()
}
.padding(.bottom)