Skip to content

Instantly share code, notes, and snippets.

View manekinekko's full-sized avatar
:octocat:
Check me out on BlueSky @wassim.dev

Wassim Chegham manekinekko

:octocat:
Check me out on BlueSky @wassim.dev
View GitHub Profile
function executerAuChargement(){ /* ... */ };
window.onload = executerAuChargement;

SFEIR Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, SFEIR SA ("SFEIR") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of SFEIR; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to SFEIR. Except for the license granted herein to SFEIR and recipients of software distributed by SFEIR, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions.

"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with SFEIR. For legal entities, the entity making a Contribution and all other enti

@manekinekko
manekinekko / actions-on-google-authorization-code.js
Last active July 26, 2018 00:44
A sample implementation to request and check the user's sign in process.
'use strict';
const {dialogflow, SignIn} = require('actions-on-google');
const functions = require('firebase-functions');
const app = dialogflow({debug: true, clientId: '5da2282196bb4243ba3bfa7f70af0369'});
app.intent('Default Welcome Intent', (conv) => {
console.log('welcomeIntent');
conv.ask(new SignIn('To get your account details'));
@manekinekko
manekinekko / binary-plist-parser.service.ts
Last active November 14, 2024 18:03
Apple's Binary Property List (bplist) parser in #JavaScript for the browser.
// const Buffer = require('buffer/').Buffer;
import { Injectable } from '@angular/core';
// Ported to browser from https://githuBuffer.com/joeferner/node-bplist-parser/blob/master/bplistParser.js
// Inspired by http://code.google.com/p/plist/source/browse/trunk/src/com/dd/plist/BinaryPropertyListParser.java
const bigInt = require('big-integer');
const Buffer = require('bops');
export const maxObjectSize = 100 * 1000 * 1000; // 100Meg
export const maxObjectCount = 32768;
@manekinekko
manekinekko / angular-dom-injector.ts
Last active May 29, 2018 23:49
This is an Angular directive that links an instance of the current injector to its DOM node.
import { Directive, ElementRef, EventEmitter, HostListener, Injector, OnDestroy, OnInit, Output, Renderer2 } from '@angular/core';
import { SketchMSLayer } from './../../state/ui.state';
import { SketchLayerComponent } from './sketch-layer.component';
@Directive({
selector: '[sketchSelectedLayer]'
})
export class SketchSelectedLayerDirective implements OnInit, OnDestroy {
@Output('selectedLayer') selectedLayer = new EventEmitter<SketchMSLayer>();
@manekinekko
manekinekko / google-spreadsheet-json-formater.ts
Last active April 6, 2018 14:15
Google Spreadsheet JSON Formatter
export class SpreadSheetFormater {
table: {};
constructor(jsonpResponse: string) {
if (!jsonpResponse) {
throw Error(`SpreadSheet JSON data is invalid. Got "${jsonpResponse}".`);
}
this.table = this.format(this.convertToJson(jsonpResponse).table);
}
private convertToJson(text: string) {
const value = text.replace('google.visualization.Query.setResponse', 'return this.google');
@manekinekko
manekinekko / spaceship-prompt__sections__angular.zsh
Last active February 14, 2025 22:34
Customize your Oh My Zsh SpaceShip theme with Angular and AngularCLI prompt (https://github.com/denysdovhan/spaceship-prompt)
SPACESHIP_ANGULAR_SHOW="${SPACESHIP_ANGULAR_SHOW:=true}"
SPACESHIP_ANGULAR_PREFIX="${SPACESHIP_ANGULAR_PREFIX:="and "}"
SPACESHIP_ANGULAR_SUFFIX="${SPACESHIP_ANGULAR_SUFFIX:="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}"
SPACESHIP_ANGULAR_SYMBOL="${SPACESHIP_ANGULAR_SYMBOL:="🅰️ "}"
SPACESHIP_ANGULAR_DEFAULT_VERSION="${SPACESHIP_ANGULAR_DEFAULT_VERSION:=""}"
SPACESHIP_ANGULAR_COLOR="${SPACESHIP_ANGULAR_COLOR:="red"}"
_is_angular_project() {
node -p "r=require('./package.json'); r.devDependencies['$1'] || r.dependencies['$1']" 2>/dev/null
}
'use strict';
// ///////////////////////// IMPORT /////////////////////////
const functions = require('firebase-functions');
const DialogflowApp = require('actions-on-google').DialogflowApp;
const f = require('node-fetch');
// ///////////////////////// SERVICES /////////////////////////
Object._values = x => Object.keys(x).map((k) => x[k]);
const SESSION = `https://ngvikings-81b48.firebaseio.com/sessions.json`;
const SPEAKERS = `https://ngvikings-81b48.firebaseio.com/speakers.json`;
'use strict';
// ///////////////////////// IMPORT /////////////////////////
const functions = require('firebase-functions');
const DialogflowApp = require('actions-on-google').DialogflowApp;
const api = require('node-fetch');
// ///////////////////////// LOGIC /////////////////////////
function getIssPosition() {
return getIssData()
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},