Skip to content

Instantly share code, notes, and snippets.

View bitbay's full-sized avatar

Daniel bitbay

  • yer vast seas of the internest
View GitHub Profile
devjin0617 / .manifest
Created May 19, 2017 15:15
chrome extension using a content script to access the `window` object
"content_scripts": [
"matches": ["http://*/*", "https://*/*"],
"js": ["inject.js"],
"all_frames": true
"web_accessible_resources": [
stormsson / config_with_memcache_sesssion.yml
Last active April 5, 2017 05:04
Symfony2 Session management
# app/config.yml
handler_id: %session_handler_id% # read from parameters.yml
#handler_id: session.handler.memcache # use service defined later
lologhi / 1.How to easily implement a REST API with oAuth2
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...


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. :

denji /
Last active April 12, 2024 03:39
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
andrey-kazakov /
Created January 23, 2013 23:26
This AngularJS directive, when added to element, repeats it's content as many times as length of given array (almost like ng-repeat). The main difference is that DOM, once built, don't being changed on each $digest(). If you want to force the changing of repeated content, you should emit an event 'invalidateView' with (optionally) name of the sc…
.module('ContentRepeat', [])
.directive 'contentrepeat', ($compile) ->
priority: 1000
terminal: true
compile: (element, attr, linker) ->
template = $compile(element.html())
(scope, self, attr) ->
thomasnordlund / authRoute.js
Created November 6, 2012 16:19 — forked from xcambar/LICENSE
Authenticated routing using AngularJS
authRouteProvider.$inject = ['$routeProvider'];
function authRouteProvider ($routeProvider) {
* Creates a controller bound to the route, or wraps the controller in param
* so the authentication check is run before the original controller is executed
* @param currentController
* @return {Function} The wrapper controller
function redirectCtrlFactory (currentController) {
_ctrl.$inject = ['currentUser__', 'userRole__', '$location'];
triceam / index.html
Created August 20, 2012 19:44
JavaScript Templating Example to show rendering techniques of JS data in HTML or XML formats.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>JSON Transform</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link href="" rel="stylesheet"></link>
adrianbravo / encrypt-decrypt.js
Created September 22, 2011 00:08
Basic Node.js crypto cipher/decipher example.
var crypto = require('crypto')
, key = 'salt_from_the_user_document'
, plaintext = 'password'
, cipher = crypto.createCipher('aes-256-cbc', key)
, decipher = crypto.createDecipher('aes-256-cbc', key);
cipher.update(plaintext, 'utf8', 'base64');
var encryptedPassword ='base64')
decipher.update(encryptedPassword, 'base64', 'utf8');