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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { |
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
<tr> | |
<td class="one-column content"> | |
<div class="column"> | |
<table class="inner" width="100%" cellpadding="10" cellspacing="0"> | |
<tr> | |
<td> | |
<div class="h3">Dear Rodrigo,</div> | |
<div class="h1"><br>Join people you know:</div> | |
</td> | |
</tr> |
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
$location->country_long = 'Canada'; | |
$location->country_short = 'CA'; | |
$location->city_long = "Saint John's"; | |
$this->assertTrue($location->save()); | |
$this->assertEquals(Location::ALIAS_PREFIX . 'Saint-John-s-Canada', $location->alias); | |
$this->assertEquals('Saint-John-s-Canada', $location->getUrl()); |
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 | |
function getGeo($lat, $lng, $dist, $brng) | |
{ | |
$lat = deg2rad($lat); | |
$lng = deg2rad($lng); | |
$brng = deg2rad($brng); | |
$distRadius = $dist / 6371; | |
$lat2 = asin(sin($lat) * cos($distRadius) + | |
cos($lat) * sin($distRadius) * cos($brng) ); |
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
git reflog expire --expire=now --expire-unreachable=now --all | |
git gc --prune=now |
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 Geocoder | |
{ | |
public static $url = 'http://maps.googleapis.com/maps/api/geocode/json'; | |
public function performRequest($search) | |
{ | |
$url = sprintf("%s?address=%s&sensor=false", self::$url, urlencode($search)); | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
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
mysql -uusername -p | |
enter password | |
use tablename | |
source path_to_sql_file |
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 | |
// Controller | |
class TestController extends CController | |
{ | |
public function actionIndex() | |
{ | |
$items = array( | |
array('id' => 1, 'name' => 'Debora'), | |
array('id' => 2, 'name' => 'Joshua'), | |
array('id' => 3, 'name' => 'Kristina'), |
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
$users = User::model()->findAll(); | |
/** | |
* @var CAuthManager $authManager | |
*/ | |
$authManager = Yii::app()->authManager; | |
$statuses = array( | |
ExtendedDbAuthManager::APPROVED => 0, | |
ExtendedDbAuthManager::BANNED => 0, |