Cross-browser function to trigger DOM events.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
# The primary network interface | |
auto eth0 | |
iface eth0 inet dhcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Vector ((!)) | |
import qualified Data.Vector as V | |
import Data.Vector.Generic.Mutable (write) | |
step ws state = case updatable of [] -> state | |
(i,_):_ -> V.modify (\v -> write v i (o i)) state | |
where | |
n = V.length state | |
w i j = ws ! i ! j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#AppStore: Install XCode | |
#install homebrew | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew doctor | |
brew update | |
curl https://gist.githubusercontent.com/pyetras/4b59e1902cfaf9af3c98/raw/Caskfile > Caskfile | |
curl https://gist.githubusercontent.com/pyetras/4b59e1902cfaf9af3c98/raw/Brewfile > Brewfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.tailrec | |
object BinarySearch { | |
/** | |
* @param xs Sequence to search | |
* @param key key to find | |
* @param min minimum index (inclusive) | |
* @param max maximum index (inclusive) | |
* @param keyExtract function to apply to elements xs before comparing to key, defaults as identity | |
* @tparam T type of elements in the sequence |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Processing code by Etienne JACOB | |
// motion blur template by beesandbombs | |
// opensimplexnoise code in another tab might be necessary | |
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e | |
int[][] result; | |
float t, c; | |
float ease(float p) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original text here: https://whydavewhy.com/2013/08/16/loyalty-and-layoffs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package slicks.docs.dao | |
import scala.slick.driver.PostgresDriver.simple._ | |
import scala.slick.driver._ | |
trait Profile { | |
val profile: JdbcProfile | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import_if_available(Ecto.Query) | |
# alias MyApp.Repo | |
defmodule R do | |
# Old habits die hard. Take a random of something. You don't care which. | |
# > R.take(SomeSchema) | |
def take(schema_or_query) do | |
schema_or_query | |
|> limit(1) | |
|> Repo.one() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see the current limits | |
$ sysctl -a | grep maxproc | |
# increase it | |
$ sudo sysctl -w kern.maxproc=xxxx | |
$ sudo sysctl -w kern.maxprocperuid=xxx | |
# run at startup | |
$ sudo vim /etc/sysctl.conf |
OlderNewer