Skip to content

Instantly share code, notes, and snippets.

View PierrickP's full-sized avatar
🦦

Pierrick PAUL PierrickP

🦦
View GitHub Profile
/**
* My class
*/
class myClass {
constructor(a) {
this.a = a;
/**
* @namespace myClass.b
.run(['$rootScope', '$state', '$stateParams', 'Config', 'Notification', function ($rootScope, $state, $stateParams, Config, Notification) {
$rootScope.lkConfig = Config.get;
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
$rootScope.$stateDestination = toState;
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
});
$rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, error){
browser.actions().mouseMove(element(by.css('#myElement'))).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
<div class="pagination pagination-centered">
<%
var startPagination = (curPage - 5 > 0) ? curPage - 5 : 1;
var endPagination = (curPage + 5 < (nbMails / 20)) ? curPage + 5 : nbMails / 20;
%>
<ul>
<li <% if (curPage == 1){ %>class="disabled"<% } %>><a <% if (curPage != 1){%>href="/admin/mail/<%= curPage - 1 %>"<% } %>>&laquo;</a></li>
<% if (startPagination != 1) { %><li class="disabled"><a>...</a></li><% } %>
<% for (var i = startPagination; i <= endPagination ; i++){ %>
<li <% if (i == curPage){ %>class="active"<% } %>><a href="/admin/mail/<%= i %>"><%= i %></a></li>
var Mongo = require('mongodb');
var fs = require('fs'),
async = require('async');
Mongo.connect("mongodb://localhost:27017/aggregation_test?w=1", function(err, db) {
var collection = db.collection('tree');
var time = Date.now();
collection.aggregate(
{
requirejs.config({
waitSeconds : 60,
paths: {
'jQuery': '/js/lib/jquery.min',
'nouislider': '/js/lib/jquery/jquery.nouislider.min',
},
shim: {
'jQuery': {
exports: 'jQuery'
},
Lian Li Mini-Q PC-Q07 USB 3.0 Edition (noir) 54,90 €
Be Quiet ! Alimentation Pure Power L7-430W 80PLUS 52,95 €
Gigabyte H77N-WIFI 96,95 €
Intel Core i3-3220 (3.3 GHz) 109,95 €
Corsair XMS3 8 Go (2x 4 Go) DDR3 1600 MHz 59,55 €
Samsung SSD 840 120 Go 89,95 €
WD Green Desktop 1 To SATA 6Gb/s 69,75 €
BenQ 21.5" LED - GW2250HM 135,90 €
Logitech Wireless Touch Keyboard K400 39,00 €
@PierrickP
PierrickP / robot.js
Created December 6, 2012 17:07
Find&shoot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.find = false;
this.shot = 0;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@PierrickP
PierrickP / robot.js
Created December 6, 2012 14:19
LeMulot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(2000);
<input type="radio">