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
defmodule Match do | |
def start(max_iterations) when is_integer(max_iterations) and max_iterations > 0 do | |
spawn(__MODULE__, :init, [max_iterations]) | |
end | |
def init(max_iterations) do | |
match = self() | |
player2 = spawn(Player, :start, [:pong, match]) | |
player1 = spawn(Player, :start, [:ping, match]) |
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
<?php | |
/** | |
* @package MySQL_Collation_Fixer | |
* @version 1.6 | |
*/ | |
/* | |
Plugin Name: MySQL Collation fixer | |
Description: Change database tables collation to utf8_general__ci after DB upgrade | |
Version: 1.0 | |
Author: Federico Parodi - weLaika |
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
.page-item#ascolta= render_partial('music/home') | |
.page-item#guarda | |
%i.fa.fa-video-camera.fa-spin | |
:javascript | |
jQuery.get('/', {ajax: 'video/home'}, function(data, textStatus, xhr) { | |
jQuery('#guarda').html(data); | |
}); |
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
<?php | |
$user_agent = getenv("HTTP_USER_AGENT"); | |
if (strpos($user_agent, "Win") !== FALSE) | |
$os = "Windows"; | |
else (strpos($user_agent, "Mac") !== FALSE) | |
$os = "Mac" | |
?> |
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
#!/bin/bash | |
# Clone the gist anyway you like in you MediaTemple GridServer and execute it with | |
# bash mt_gs_rdiff-backup_installer.sh | |
# No params, no questions, just straight. Logout and log back after script's ended | |
# Credits to @weliaka: https://github.com/welaika http://welaika.com http://pisadmin.welaika.com | |
# Also follow ups on this article are welcome: | |
# http://pisadmin.welaika.com/post/44637112969/our-definitive-mt-grid-service-backup-solution | |
cd ~/data/tmp | |
wget http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-1.2.8.tar.gz |
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
#!/bin/bash | |
# 20130130 | |
# This is a fork of the original script, adapted to work as bash installer on a | |
# pre-deployed Centos6 system. It takes args from bash invocation. It is not yet | |
# documented and all the following comments are originals from RedHat's guys. | |
# This is *REALLY* a wip and not usable by anyone without a bit of docs. | |
# We'll write down something when it will a bit tested and refactorized. | |
# This script configures a host system with OpenShift components. |
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
# Text color variables | |
txtred=$(tput setaf 1) #Red | |
txtgre=$(tput setaf 2) # Green | |
txtyel=$(tput setaf 3) # Yellow | |
txtblu=$(tput setaf 4) # Blue | |
txtbol=$(tput bold) # Bold | |
txtres=$(tput sgr0) # Reset | |
# Helper feedback functions | |
function info() { |
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
# Text color variables | |
txtred=$(tput setaf 1) #Red | |
txtgre=$(tput setaf 2) # Green | |
txtyel=$(tput setaf 3) # Yellow | |
txtblu=$(tput setaf 4) # Blue | |
txtbol=$(tput bold) # Bold | |
txtres=$(tput sgr0) # Reset | |
# Helper feedback functions | |
function info() { |
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
#!/bin/bash | |
# Set a new vhost in lamp for Linux. | |
# .vhostrc is adaptable for LAMPP: just add in your | |
# /opt/lampp/etc/httpd.conf a section like this: | |
# | |
# # Virtual hosts | |
# Include etc/extra/sites-enabled/* | |
# | |
# and create such dir: | |
# $sudo mkdir /opt/lampp/etc/extra/sites-enabled/ |
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
#!/bin/bash | |
#Install latest WordPress release in a specific path | |
#and don't bother any more! :) | |
if [[ ! $1 ]]; then | |
echo "Please, pass to me destination path as first argument! :)" | |
exit 1 | |
fi | |
path=$1 |