Skip to content

Instantly share code, notes, and snippets.

View avargas's full-sized avatar

Angelo Vargas avargas

View GitHub Profile
<?php
class Controller {
public function run ()
{
SomeLibrary::accidentalStatic();
}
public function __toString ()
{
@avargas
avargas / monitor-run.php
Created April 24, 2012 21:19
php script rerun on saved changes
<?php
function monitor ($file)
{
$last = filemtime($file);
$command = trim(`which php`);
$command .= " -f " . $file;
$command .= ' 2>&1';
{
type: 'cluster',
members: [
{
type: 'shard',
members: [
{
type: 'mongod',
name: 'shard1'
},
{
'mongod': [
{'ip': '1.2.3.4:1234'},
{'ip': '1.2.3.4:1234'},
{'ip': '1.2.3.4:1234'}
],
'config': [
{'ip': '1.2.3.4:1234'},
{'ip': '1.2.3.4:1234'},
@avargas
avargas / gist:2624785
Created May 6, 2012 22:08
autorun command automatically
<?php
class Colors {
private $foreground_colors = array();
private $background_colors = array();
public function __construct() {
// Set up shell colors
$this->foreground_colors['black'] = '0;30';
$this->foreground_colors['dark_gray'] = '1;30';
<script>
$(document).ready(function() {
$(".boton")
.bind("touchstart", function () {
$(this).addClass("active");
})
.bind("touchend", function() {
$(this).removeClass("active");
})
.bind("touchcancel", function() {
ini_set('log_errors', 'On');
ini_set('error_log', __DIR__ . '/phperrors.log');
ini_set('log_errors_max_len', 0);
CSS:
#preview-foot {
position:absolute;
border:1px solid #ccc;
background:#333;
padding:5px;
display:none;
color:#fff;
((320*320) * 10) * 0.073
>>> a = None
>>> type(a)
<type 'NoneType'>
>>> a = 1
>>> type(a)
<type 'int'>
>>> a = "angelo"
>>> type(a)