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
@manekinekko
manekinekko / cloudbuild.cicd.yaml
Last active November 13, 2018 15:52
Google Cloud Build config file for xlayers.app (CI + CD)
steps:
- name: 'gcr.io/cloud-builders/npm'
id: 'Install dependencies'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
id: 'Lint'
args: ['run', 'lint']
- name: 'gcr.io/cloud-builders/npm'
@manekinekko
manekinekko / cloudbuild.ci.yaml
Last active November 13, 2018 15:48
Google Cloud Build config file for xlayers.app (CI only)
steps:
- name: 'gcr.io/cloud-builders/npm'
id: 'Install dependencies'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
id: 'Lint'
args: ['run', 'lint']
- name: 'gcr.io/cloud-builders/npm'
const elements = document.querySelectorAll('button');
const len = elements.length; // 8 par exemple
for(let i=0; i<len; i+=1){
(function(n){
elements[n].addEventListener('click', function(){
alert(n+1)
}, false);
const elements = document.querySelectorAll('button');
const len = elements.length; // 8 par exemple
for(let i=0; i<len; i+=1){
elements[i].addEventListener('click', function() {
alert(i+1)
}, false);
}
const jedi = (function(what) {
const say = `I'm your ${what}!`;
return (() => `Luke, ${say}`)();
})("father");
console.log(jedi); // "Luke, I'm your father!"
// A
const luke = function(){};
const jedi = luke();
// B
const luke = function(){};
const jedi = (luke)();
// C
const jedi = (function(){})();
const delay = curry(setTimeout, 1000);
delay(() => alert("POWNED!!"));
function curry() {
const [fn, ...restArgs] = Array.from(arguments);
return function() {
const args = Array.from(arguments);
return fn.apply(null, args.concat(restArgs));
};
};
<style>
#content {
width: 27px;
height: 40px;
background: red;
position: relative;
border-radius: 50%;
line-height: 40px;
padding-left: 14px;
color: white;