Skip to content

Instantly share code, notes, and snippets.

View filaruina's full-sized avatar

Filipe La Ruina filaruina

  • Spotify
  • Stockholm
View GitHub Profile
@filaruina
filaruina / gist:645373
Created October 25, 2010 17:43
Sorting array?
$teste = array(
array("foo" => "a", "bar" => "b", "timestamp" => 123456),
array("foo" => "a", "bar" => "b", "timestamp" => 987654),
array("foo" => "a", "bar" => "b", "timestamp" => 654789),
array("foo" => "a", "bar" => "b", "timestamp" => 456123)
);
/*
* how to transform that, in this (I mean, ordered by date)
*/
@filaruina
filaruina / workdDays.php
Last active December 19, 2015 15:48
A simple function to find work days in a time period, using DateTime, DateInterval and DatePeriod. Some refactoring tips are appreciated =)
<?php
function findWorkDays($dateStart, $dateEnd)
{
$oneWeek = new \DateInterval('P7D');
$date1 = new \DateTime($dateStart);
$date2 = new \DateTime($dateEnd);
$interval = $date1->diff($date2);
$freeDays = 0;
//Finding saturdays
@filaruina
filaruina / dabblet.css
Created July 15, 2013 14:36 — forked from anonymous/dabblet.css
Botao from Hell
/**
* Botao from Hell
* Resolvido!
* removi o height e coloquei só o line-height e ele ficou alinhado no Fx e Chrome
*/
.btn {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background: #515733;
@filaruina
filaruina / dabblet.css
Created August 13, 2013 19:58
Untitled
*{margin:0;padding:0;box-sizing:border-box;}
body{padding:5px;}
li{list-style: none;}
.top_bar {
width: 700px;
height: 30px;
border: 1px solid #f00;
}