Skip to content

Instantly share code, notes, and snippets.

@lsei
lsei / install.sh
Last active August 29, 2015 14:28 — forked from JeffreyWay/install.sh
Super-fast LAMP + 5.5 install script.
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
@lsei
lsei / Vagrantfile
Last active August 29, 2015 14:28 — forked from JeffreyWay/Vagrantfile
Quickie vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
@lsei
lsei / .block
Last active July 9, 2017 11:31
Monzo Zoomable Circles
height: 600
license: none
@lsei
lsei / .block
Last active October 13, 2017 17:32
Doors Collaborators v1
height: 1000
license: none
@lsei
lsei / .block
Last active October 14, 2017 18:12
Doors Collaborators v2
height: 1000
license: none
@lsei
lsei / .block
Last active October 25, 2017 20:21
Network of nodes in two groups
height: 1000
license: none
@lsei
lsei / 1-react-native-simulator-and-device.md
Created November 28, 2017 11:59 — forked from almost/1-react-native-simulator-and-device.md
Test React Native on the simulator and on a device without editing the code each time!

In the default React Native app scaffolding you have to edit AppDelegate.m to change where it loads the code if you want to test on your device. I use the following snippet to detect if it's being compiled for Debug or Production and for the Simulator or a device. For Production it uses a copy of the code included in the bundle, for Debug on the simualtor it loads from a server on localhost and for Debug on a device it loads from a server on a given IP address.

NOTE: You need to edit YOUR-IP-HERE and change it to the IP to load the code from when in Debug mode on a device. You could use a service like ngrok to make this work from anywhere.

  NSURL *jsCodeLocation;

  // Loading JavaScript code
  #if DEBUG
    // For Debug build load from development server. Start the server from the repository root:
@lsei
lsei / MiniJSON.cs
Created March 24, 2018 18:46 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@lsei
lsei / .block
Last active May 6, 2018 14:51
Top Electronic artists by genre
height: 1000
@lsei
lsei / countries
Last active May 6, 2018 16:48 — forked from kalinchernev/countries
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Anguilla
Antigua & Barbuda
Argentina
Armenia
Aruba