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 | |
// Altere as configurações | |
$config = array( | |
'version' => '5.3.7', | |
'max_size' => '10M', | |
'dir' => 'exemplo_escrita', | |
'database' => array( | |
'host' => 'localhost', |
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
# You can run the following commands from any directory. | |
curl -sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composerecho 'alias composer="/usr/local/bin/composer.phar"' >> ~/.bash_profile | |
composer global require "laravel/envoy=~1.0" | |
echo 'alias envoy=".composer/vendor/laravel/envoy/envoy"' >> ~/.bash_profile |
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 | |
while [ 1 ] | |
do | |
if [ $(networksetup -getinfo Wi-Fi | grep -c 'IP address:') = '1' ] | |
then $(networksetup -setairportnetwork en1 DigitalBox q2w3e4r5) | |
fi | |
sleep 3 | |
done |
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 | |
// Extracted from the Laravel Framework (http://laravel.com) | |
function toSlug($title, $separator = '-', $to_lower = true) { | |
// Convert all dashes/underscores into separator | |
$flip = $separator == '-' ? '_' : '-'; | |
$title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); |
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 | |
/* | |
* From: http://stackoverflow.com/questions/3392993/php-regex-to-get-youtube-video-id | |
*/ | |
$url = "http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate"; | |
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); | |
echo $my_array_of_vars['v']; | |
// Output: C4kxS1ksqtw |
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
var GmapComponent = require('./google-maps-component'); | |
var component = GmapComponent({ | |
lat: -23.5348644, lng: -46.6718231 | |
}); | |
var node = document.getElementById('main'); | |
React.renderComponent(component, node); |
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
var _ = require('lodash'); | |
module.exports = _.curry(replaceParent, 2); | |
function replaceParent(element, html) { | |
var parent = element.parentNode; | |
parent.innerHTML = html; | |
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
{ | |
"collection": { | |
"version": "1.0", | |
"href": "http://www.youtypeitwepostit.com/api/", | |
"items": [ | |
{ | |
"href": "/api/messages/21818525390699506", | |
"data": [ | |
{ | |
"name": "text", |
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 | |
class Scorer { | |
private $canonical; | |
private $game; | |
public function __construct($game) | |
{ |
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 | |
class Krudder { | |
public static function add($route, $modelName) | |
{ | |
App::bind("Krudder$route", function() use($route, $modelName) | |
{ | |
return new KrudderController($route, $modelName); | |
}); |