Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / getdashing.sh
Created May 11, 2014 09:13
#!/bin/sh
#@see https://gist.github.com/stonehippo/5896381
ECHO Get Dashing for Raspberry Pi
sudo apt-get update
sudo apt-get install git-core git build-essential libssl-dev zlib1g-dev nodejs
git clone https://github.com/joyent/node.git
cd node
git checkout v0.8.8 -b v0.8.8
curl https://github.com/joyent/node/commit/25c2940a08453ec206268f5e86cc520b06194d88.patch | git am
curl https://github.com/joyent/node/commit/1d52968d1dbd04053356d62dc0804bcc68deed8a.patch | git am
@gialloporpora
gialloporpora / imgur.bat
Created June 12, 2012 21:53
Upload image on ImgUr (anonymous) with history using commandline. It requires sed and curl.
@echo off
REM Set you API KEY http://imgur.com/register/api_anon
set apikey=your_apikey_here
REM Usage:
REM img file_path [title] [caption]
REM img url [title] [caption]
REM title and caption are optional, quote them if they contains spaces or strange characters
REM Set the path where are located curl.exe and sed.exe
@jpswade
jpswade / gist:4571750
Created January 19, 2013 10:06
How do you remove numbers from a string in PHP?
<?php
$string = 'abc123';
$string = str_replace(range(0,9), '', $string);
echo $string;
/* http://codepad.org/AYECJrbZ */
?>
@jeffreybarke
jeffreybarke / ci-encryption-key-generator.php
Created April 9, 2013 17:21
This is the code I use (minus Google Analytics) for the CodeIgniter encryption key generator located at http://jeffreybarke.net/tools/codeigniter-encryption-key-generator/
<?php
/**
* Generate an encryption key for CodeIgniter.
* http://codeigniter.com/user_guide/libraries/encryption.html
*/
// http://www.itnewb.com/v/Generating-Session-IDs-and-Random-Passwords-with-PHP
function generate_token ($len = 32)
{
@tPl0ch
tPl0ch / build.xml
Created December 2, 2012 03:51
Ant build file for PHP projects including Behat build task
<?xml version="1.0" encoding="utf-8"?>
<project name="your-project-name-here" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,behat,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
@hm2k
hm2k / leftshift32
Created May 13, 2012 20:25
Performs a 32-bit left shift operation (<<) even on a 64-bit machine
/**
* Performs a 32-bit left shift operation (<<) even on a 64-bit machine
*
* @param integer $number Shift these bits
*
* @param integer $steps Step this many times
*
* @return string Returns the integer
*/
function leftshift32 ($number, $steps)
@jk
jk / README.md
Last active April 27, 2018 18:02
Behat + Mink + Selenium 2 Stack

Important files

Here you find the DSL language definition for your phrases you can use in .feature files:

  • features/bootstrap/FeatureContext.php inherits from
  • vendor/behat/mink-extension/Behat/MinkExtension/Context/MinkContext.php

Installation

With Homebrew that gets really easy:

@wesee
wesee / README.md
Last active January 11, 2019 20:37
Weatheroutlook Dashing Widget
@snipe
snipe / build-ant-phpunit
Created November 22, 2012 21:08
Apache Ant build.xml file for PHPUnit+Jenkins+Ant+Zend Framework
<?xml version="1.0" encoding="UTF-8"?>
<!-- Set some basic project information and targets -->
<project name="My ZF Project" default="build">
<target name="build"
depends="prepare, lint, phploc, phpmd, phpcpd, phpcs, phpunit"/>
<target name="build-parallel"
depends="prepare,lint, tools-parallel, phpcpd, phpunit"/>
@jeffreymorganio
jeffreymorganio / uk-bounding-box.geojson
Created October 6, 2015 08:53
Longitude and latitude bounding box around the UK
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.