Skip to content

Instantly share code, notes, and snippets.

View bertrandg's full-sized avatar
:octocat:
 

bertrandg bertrandg

:octocat:
 
  • Lyon, FRANCE
View GitHub Profile
(function () {
var i, data, scope,
count = 0,
all = document.all,
len = all.length,
test = {};
for (i=0; i < len; i++) {
data = angular.element(all[i]).data();
if (data.hasOwnProperty('$scope') && data.$scope.$$watchers) {
var debugWatchers = function(selector, showExp) {
var target, i, checkInsideFn, jq, items,
nb_watchers = 0,
nb_scopes = 0,
scopes_id = {};
if(typeof jQuery == 'undefined') {
jq = document.createElement('script');
jq.type = 'text/javascript';
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js';
.ng-scope {
outline: 1px solid blue;
}
(function(){
var all_ids = [];
var duplicate_ids = [];
$('[id]').each(function(index){ all_ids.push( $(this).attr('id') ) })
all_ids = all_ids.sort();
for (var i = 0; i < all_ids.length - 1; i++) {
if (all_ids[i + 1] == all_ids[i]) duplicate_ids.push(all_ids[i]);
}
console.log('duplicate id: ', duplicate_ids);
})()
<?php
// required Facebook PHP SDK v4.0.9 or later.
// include required files form Facebook SDK
require_once( 'Facebook/HttpClients/FacebookHttpable.php' );
require_once( 'Facebook/HttpClients/FacebookCurl.php' );
require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' );
require_once( 'Facebook/Entities/AccessToken.php' );
require_once( 'Facebook/Entities/SignedRequest.php' );

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@bertrandg
bertrandg / readme.md
Last active August 29, 2015 14:17 — forked from paulirish/readme.md

console.log wrap resolving for your wrapped console logs

I've heard this before:

What I really get frustrated by is that I cannot wrap console.* and preserve line numbers

We enabled this in Chrome DevTools via blackboxing a bit ago.

If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.

@include keyframe(fadeout) {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@bertrandg
bertrandg / ngrxintro.md
Created June 11, 2016 20:06 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@bertrandg
bertrandg / ngrx-effects-simple-example.js
Last active February 14, 2017 16:06
ngrx/effects simple example
@Effect() actionX$ = this.updates$
.ofType('ACTION_X')
.map(toPayload)
.switchMap(payload => this.api.callApiX(payload)
.map(data => ({type: 'ACTION_X_SUCCESS', payload: data}))
.catch(err => Observable.of({type: 'ACTION_X_FAIL', payload: err}))
);
@Effect() actionY$ = this.updates$
.ofType('ACTION_Y')