This file contains hidden or 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
/** | |
* Threw together by Richard Willis - badsyntax.co | |
*/ | |
var service = new google.maps.places.AutocompleteService(); | |
var geocoder = new google.maps.Geocoder(); | |
$(field).typeahead({ | |
source: function(query, process) { | |
service.getPlacePredictions({ input: query }, function(predictions, status) { |
This file contains hidden or 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
db.getCollection('attrib_cd').find({}).forEach(function(doc) { | |
doc['qid'] = doc["0"]; | |
delete doc["0"]; | |
db.getCollection('attrib_cd').save(doc); | |
}); |
This file contains hidden or 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
// json request parser | |
$app->before(function ($request) { | |
if (0 === strpos($request->headers->get('Content-Type'), 'application/json')) { | |
$data = json_decode($request->getContent(), true); | |
$request->request->replace(is_array($data) ? $data : []); | |
} | |
}); |
This file contains hidden or 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 | |
namespace Acme\App\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Silex\Application; | |
use Silex\Api\ControllerProviderInterface; | |
use Acme\Util\Database; |
This file contains hidden or 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
import {Directive, ElementRef, Input} from '@angular/core'; | |
@Directive({ | |
selector: '[background-image]' | |
}) | |
export class BackgroundImage { | |
private el: HTMLElement; | |
constructor(el: ElementRef) { | |
this.el = el.nativeElement; |
This file contains hidden or 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
import {ImageloaderDirective} from './directives/imageloader/imageloader.directive'; | |
@NgModule({ | |
... | |
declarations: [ | |
ImageloaderDirective | |
], | |
... | |
}) |