Skip to content

Instantly share code, notes, and snippets.

@thrashr888
thrashr888 / dColors.class.php
Created January 26, 2011 19:09
My class that I used to produce and convert color values.
<?php
class dColors{
CONST WHITE = "#FFFFFF";
CONST BLACK = "#000000";
CONST RED = "#FF0000";
CONST GREEN = "#00FF00";
CONST BLUE = "#0000FF";
@docteurklein
docteurklein / gist:5064805
Created March 1, 2013 13:53
failing test case for ReflectionMethod::getPrototype() when a class is using a trait that defines a method, chich class extends another class that defines the same method too.
<?php
trait TestTrait
{
public function getKernel()
{
}
}
class BaseTest
@npryce
npryce / Makefile
Created December 16, 2016 13:33
Pandoc Makefile example
MARKDOWN_SRC:=$(shell find doc -name '*.md')
DIAGRAM_SRC:=$(shell find doc -name '*.plantuml')
MARKDOWN_FORMAT=markdown+fenced_code_blocks+fenced_code_attributes+grid_tables+footnotes
# Order is significant when multiple CSS files
CSS_SRC:=styles/style.css
SITE_HTML=$(MARKDOWN_SRC:doc/%.md=out/site/%.html) $(DIAGRAM_SRC:doc/%.plantuml=out/site/%.png)
SITE_CSS=$(CSS_SRC:styles/%=out/site/%)
@statianzo
statianzo / jade.vim
Created November 20, 2010 03:51
Jade syntax highlighting for vim
" Vim syntax file
" Language: Jade
" Filenames: *.jade
" Ported from tvim-haml - https://github.com/tpope/vim-haml
" For use with Jade - http://jade-lang.com/
" Now maintained at: https://github.com/statianzo/vim-jade
if exists("b:current_syntax")
finish
endif
@jakzal
jakzal / selenium.sh
Last active February 16, 2018 17:32
Selenium grid runner
#!/bin/sh
command=${1:-"help"}
SELENIUM_VERSION="2.39.0"
NODE_OPTIONS="-browser browserName=phantomjs"
download() {
[ -f selenium-server-standalone.jar ] || wget http://selenium.googlecode.com/files/selenium-server-standalone-${SELENIUM_VERSION}.jar -Oselenium-server-standalone.jar
}
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
@blazarecki
blazarecki / PopupDictionary.php
Last active November 10, 2021 15:54
Alert, confirm and prompt with mink
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <benjamin.lazarecki@gmail.com>
*/
trait PopupDictionary
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active July 3, 2023 05:25
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@efcasado
efcasado / eqc.md
Last active December 16, 2023 00:07
A gentle introduction to (Erlang) QuickCheck

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011 23:18
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {