Skip to content

Instantly share code, notes, and snippets.

# http://rspec.info/
# http://peepcode.com/products/rspec-user-stories
# http://dannorth.net/whats-in-a-story
# http://www.lukeredpath.co.uk/2006/8/29/developing-a-rails-model-using-bdd-and-rspec-part-1
# http://www.benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories/
# http://www.benmabey.com/2008/02/04/rspec-plain-text-stories-webrat-chunky-bacon/
# http://www.chariotsolutions.com/slides/pdfs/ete2008-IntegrationTestingWithRSpec.pdf
# http://www.joesniff.co.uk/ruby/telling-a-good-story-rspec-stories-from-the-trenches.html
# How does using stories help testing?
#!/usr/bin/env bash
# Configurable variables
database='vagrant'
username='vagrant'
password='vagrant'
echo ''
echo ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ' Bootstrapping Ubuntu Precise 32bit for Laravel 4'
@spham
spham / mysql-5.6.sh
Created September 10, 2013 14:31
Installation de mysql 5.6 debian wheezy et squeeze
#!/bin/bash
echo "Mise a jour du systeme"
apt-get update && aptitude -y safe-upgrade
apt-get install libaio1
groupadd mysql
useradd -r -g mysql mysql
wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.13-debian6.0-x86_64.deb
dpkg -i mysql-5.6.13-debian6.0-x86_64.deb
chown -R mysql /opt/mysql/server-5.6
@spham
spham / install-ispconfig3-ubuntu.sh
Created July 2, 2016 23:37
Install ISPConfig3 Ubuntu 14.04 64Bits
#!/bin/bash
## Install ISPConfig3 on Ubuntu 14.04 64Bits
## Author: Nilton OS www.linuxpro.com.br
## https://www.howtoforge.com/perfect-server-ubuntu-14.04-apache2-php-mysql-pureftpd-bind-dovecot-ispconfig-3
## Version 0.5
## Set lang en_US UTF8
## echo 'LC_ALL="en_US.utf8"' >>/etc/environment
#!/bin/bash
## Install LEMP MariaDB, Exim4, PureFTP on Debian 8 x86_64
apt update
apt install dialog
dpkg-reconfigure locales
dpkg-reconfigure tzdata
@spham
spham / gist:62fe0f2fa6d882627f27a9034c7cc5aa
Created September 13, 2016 10:03 — forked from fduran/gist:1870429
Linux disk space email alert
#!/bin/bash
# www.fduran.com
# script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX
# adapt these 3 parameters to your case
MAX=95
EMAIL=alert@example.com
PART=sda1
USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`
if [ $USE -gt $MAX ]; then
@spham
spham / git_kristaps_cheatsheet
Created January 2, 2017 11:46
Git bash cheatsheet
Add files to staging:
git add -A (visi faili)
vai:
git add filePath
Commit to local rep:
git commit -m 'METRO-82'
Push to branch/trunk (our branch name is develop)
git push origin develop
@spham
spham / get-browser-language.php
Created July 3, 2017 20:43 — forked from LucaRosaldi/get-browser-language-code.php
PHP: Detect Browser Language
<?php
/**
* Get browser language, given an array of avalaible languages.
*
* @param [array] $availableLanguages Avalaible languages for the site
* @param [string] $default Default language for the site
* @return [string] Language code/prefix
*/
function get_browser_language( $available = [], $default = 'en' ) {
if ( isset( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ] ) ) {
@spham
spham / wget-snapshotpage.md
Created March 22, 2018 22:39 — forked from dannguyen/wget-snapshotpage.md
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

L'application FODMAP permet :
- de donner votre avis anonymement sur les produits et ingredients FODMAP
- d'utilisr votre caméra pour scanner les produits
et en récuperer les informations de la base de données OpenFoodFacts
A part les numéros des codes barres scannés et vos avis anonyme,
aucunes données ne sont envoyées à un ou des serveur(s) extérieurs.