Skip to content

Instantly share code, notes, and snippets.


Benjamin Horn beije

View GitHub Profile
beije / Loading.js
Last active Oct 26, 2019
React-native loading component example for my blog post about react-native animations -
View Loading.js
import React from 'react';
import { Animated, Easing, Image, StyleSheet, View } from 'react-native';
const Loading = (props) => {
const iconAnimation = new Animated.Value(0);
// Loop the animation
beije / settings.json
Last active Nov 9, 2015
Visual Studio Code Settings
View settings.json
// Place your settings in this file to overwrite the default settings
"editor.fontFamily": "Courier New",
"editor.glyphMargin": true,
"editor.renderWhitespace": true,
"javascript.validate.lint.curlyBracketsMustNotBeOmitted": "warning",
"editor.tabSize": "4",
"editor.fontSize": 14,
"editor.insertSpaces": "true"
beije / gist:224cfb66c327f3e36f54
Last active Aug 29, 2015
Fibonacci with ES6 generators
View gist:224cfb66c327f3e36f54
function *fibonacci(numbers) {
var prevValue = 0;
var currentValue = 1;
var newValue = 0;
for(var i = 0; i < numbers; i++) {
newValue = currentValue+prevValue;
prevValue = currentValue;
currentValue = newValue;
yield currentValue;
beije / index.html
Created Feb 24, 2015
Vignetting an image in CSS
View index.html
<div class="image-container">
<img src="myimage.jpg" />
View InfiniteScroll.js
(function($, window, undefined) {
var InfiniteScroll = function() {
this.initialize = function() {
this.setupEvents = function() {
beije / devenv.conf
Created Apr 16, 2014
VirtualHost multiple dev environments
View devenv.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
VirtualDocumentRoot "/var/www/%0"
ServerName localhost
ServerAlias *
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
beije / CameraRaw.php
Last active Nov 15, 2018
A small PHP class that can handle the extraction of preview files from a camera RAW file. Dependencies: imagemagick, ufraw and exiv2.
View CameraRaw.php
* A class that can fetch preview images from camera raw files.
* In order to use this class you'll need a few php mods and
* some other software installed on your server.
* - imagemagick (Manage images)
* - ufraw (Reading and converting raw files)
beije /
Last active Oct 23, 2019
An example apache virtual host config for internal proxying. A wonderous hack if you lack control of DNS servers and need to test a site on a device that doesn't let you modify the hosts file.
<VirtualHost *:80>
# Set url to proxy
ProxyPass /
ProxyPassReverse /
# Set location
<location />
# Set url
You can’t perform that action at this time.