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 | |
uses('http_socket'); | |
class GeocodedBehavior extends ModelBehavior { | |
/** | |
* Index of geo-data lookup services. Each item contains a lookup URL with placeholders, | |
* and a regular expression to parse latitude and longitude values. | |
* | |
* @var array |
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
# Query to get closest 10 records | |
SELECT `Idea`.`id`, `Idea`.`title`, `Idea`.`description`, `Idea`.`vote_count`, `Idea`.`fullname`, `Idea`.`location`, `Idea`.`orgname`, `Idea`.`finalist`, `Idea`.`semifinalist`, `Idea`.`winner`, `Idea`.`broker_winner`, `Idea`.`receive_donations`, `User`.`broker`, `User`.`brokerage_id`, `Category`.`id`, `Category`.`file_name`, `User`.`id` FROM `ideas` AS `Idea` LEFT JOIN `users` AS `User` ON (`Idea`.`user_id` = `User`.`id`) LEFT JOIN `categories` AS `Category` ON (`Idea`.`category_id` = `Category`.`id`) WHERE `Idea`.`removed` = 0 AND `Idea`.`approved` = 1 AND `contestyear` = '2010-01-01' AND ((((ROUND(`Idea`.`lat`, 4) != 43.666700) AND (ROUND(`Idea`.`lon`, 4) != -79.416700))) OR (((`Idea`.`lat` = 43.666700) AND (`Idea`.`lon` = -79.416700)))) ORDER BY (6371 * 2 * ATAN2( SQRT( SIN(RADIANS(43.6667 - `Idea`.`lat`)/2) * SIN(RADIANS(43.6667 - `Idea`.`lat`)/2) + SIN(RADIANS(-79.4167 - `Idea`.`lon`)/2) * SIN(RADIANS(-79.4167 - `Idea`.`lon`)/2) * COS(RADIANS(43.6667)) * COS(RADIANS(-79. |
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
110.232.176.0/22 | |
117.18.232.0/21 | |
46.22.64.0/20 | |
68.232.32.0/20 | |
72.21.80.0/20 | |
93.184.208.0/20 | |
108.161.240.0/20 | |
117.103.183.0/24 | |
46.22.78.0/23 |
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 if (preg_match('/http:\/\/www.youtube.com\/watch.*/', $this->request->data['Upload']['embed'], $matches)) { | |
parse_str(parse_url($this->request->data['Upload']['embed'],PHP_URL_QUERY),$vars); | |
$videoid = $vars['v']; | |
if (!$videoid) { break; } | |
$this->request->data['Upload']['type'] = 'youtube'; | |
$this->request->data['Upload']['attribution'] = $videoid; | |
$videoThumb = $this->_getThumbYoutube($videoid); | |
} | |
if (preg_match('/http:\/\/(www\.)?vimeo.com\/(\d+)/', $this->request->data['Upload']['embed'], $matches)) { | |
$videoid = $matches[2]; |
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
# Intended Query | |
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"query_string": { | |
"query": "intel", | |
"fields": [ | |
"Name^5", |
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
Environment: | |
Redmine version 2.1.4.stable.10973 | |
Ruby version 1.8.7 (i486-linux) | |
Rails version 3.2.8 | |
Environment production | |
Database adapter MySQL | |
Redmine plugins: | |
no plugin installed | |
NoMethodError (cannot parse Cookie header: undefined method `size' for nil:NilClass): |
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
Tail = require('tail').Tail; | |
tail = new Tail("latest.log"); | |
HipChatClient = require('node-hipchat') | |
hipchat = new HipChatClient("*************************"); | |
var loginPattern = /.*\[Server thread\/INFO\]: (.*) joined the game/; | |
tail.on("line", function(data) { | |
var loginMatch = data.match(loginPattern); |
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
### Keybase proof | |
I hereby claim: | |
* I am ryantology on github. | |
* I am ryantology (https://keybase.io/ryantology) on keybase. | |
* I have a public key whose fingerprint is FF9D 7C56 0875 58A4 BB45 B935 A1DD B652 4A1F 4255 | |
To claim this, I am signing this object: |
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 | |
// routes.php | |
Route::group(array('before' => 'check_auth', 'prefix' => 'admin', 'namespace' => 'Admin'), function() { | |
Route::resource('ideas', 'IdeasController'); | |
}); | |
// app/Controllers/Admin/IdeasController.php | |
namespace Admin; | |
class IdeasController extends \IdeasController { |
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
MS Word smart quote: Projet d’apprentissage, la présentation d’idée doit être faite au nom d’un organisme | |
VS Straight Quotes: Projet d'apprentissage, la présentation d'idée doit être faite au nom d'un organisme |
OlderNewer