Skip to content

Instantly share code, notes, and snippets.

View Rebolon's full-sized avatar
🤩
going back to Angular (v16)

Benjamin RICHARD Rebolon

🤩
going back to Angular (v16)
View GitHub Profile
@Rebolon
Rebolon / gist:fadaf1c67799fb6bc54d
Created March 23, 2015 08:30
Improve lisibility
Template.registerHelper('setCardHeight',function(tabletCards){
var tabletCount = tabletCards.length;
var tabletCardWidth = 450;
var screenWidth = $(window).width();
var cardsPerRow = Math.floor(screenWidth / tabletCardWidth);
if (cardsPerRow <= 1) {
return;
}
for (var i=0; i<tabletCount; i+=cardsPerRow) {
@Rebolon
Rebolon / gist:3b6d2ea36423c2bda633
Created April 21, 2015 07:23
start meteor with different mongodb version (windows version)
//bat script where host and port are parameters, but you can also force them or set defaults if they are not sent
SET MONGO_URL=mongodb://%1:%2/meteor
meteor > logs/meteor.log
@Rebolon
Rebolon / J2 - P8_26
Created May 9, 2015 09:19
BeagleBoard + PIR Motion Sensor
/**
* on J3 & J7 there is no GPIO so don't use it when playing with Digital sensor
*/
var b = require('bonescript'),
led = "USR0",
sensor = "P9_26";
b.pinMode(led, b.OUTPUT);
b.pinMode(sensor, b.INPUT);
@Rebolon
Rebolon / getOneUserEmail
Created September 8, 2015 13:30
get one email from MeteorJs user profile
// it will retreive all verified address and return the first one
// if none found, it will juste return the first address
var email = _.chain(Meteor.user().emails).each(function(email) {
if (email.verified === true) {
return email;
}
}).value() || _.first(Meteor.user().emails);
@Rebolon
Rebolon / Clean your profile
Last active December 10, 2015 11:21
Transform your linkedin preview page into cool html cv
// go on https://www.linkedin.com/profile/preview?locale=en_US&trk=prof-0-sb-preview-primary-button
// and copy paste those in your console
// différents en-tetes
$('div[id=header], div[id=text-ad-container], div[id=preview-ctx]').remove();
//barre latéral
$('div[id=aux]').remove();
// titre Parcours
$('#background h2').remove();
// suppression du résumé si besoin
@Rebolon
Rebolon / WebTestCase.php
Last active December 25, 2015 18:59
Allow client to add cookies in WebTestCase
<?php
namespace atoum\AtoumBundle\Test\Units;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use atoum\AtoumBundle\Test\Asserters;
use mageekguy\atoum;
use Symfony\Component\CssSelector\CssSelector;
@Rebolon
Rebolon / nginx as a proxy for meteor
Created February 1, 2016 15:04
A simple nginx conf to allow reviewer to reproduce a camera issue with mdg:camera from meteor
# first generate your self-signed certificates : openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl/nginx.key -out ssl/nginx.crt
# and put them in nginx/ssl folder
worker_processes 1;
events {
worker_connections 1024;
}
http {
@Rebolon
Rebolon / meteor.d.ts
Created April 11, 2016 20:33 — forked from tomitrescak/meteor.d.ts
Typescript definition for Meteor 1.3
// Type definitions for Meteor 1.3
// Project: http://www.meteor.com/
// Definitions by: Dave Allen <https://github.com/fullflavedave>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* These are the common (for client and server) modules and interfaces that can't be automatically generated from the Meteor data.js file
*/
interface EJSONable {
@Rebolon
Rebolon / interceptors.js
Created March 13, 2017 17:32
#vuejs : vue-resource cache plugin with PouchDB
/**
* allow to cache response and/or to listen on newRequest event
*
* for cache system, it's freely adapted from https://github.com/pagekit/vue-resource/issues/252 @airtonix sample
*/
export class HttpInterceptors {
_cache
constructor (Vue, ttlInHours) {
@Rebolon
Rebolon / git-clean-branch
Created September 20, 2017 08:00
clean git branch already merged
!git branch --merged | grep -v '\*' | xargs -n 1 git branch -d