Skip to content

Instantly share code, notes, and snippets.

View id0Sch's full-sized avatar
🕳️
Digging

Ido S id0Sch

🕳️
Digging
View GitHub Profile
@id0Sch
id0Sch / snippet
Created November 15, 2018 08:55
debug CSS snippet
javascript:(()=>{var s= document.createElement('style');s.innerHTML='*:not(path):not(g) {color: hsla(210, 100%, 100%, 0.9) !important;background: hsla(210, 100%, 50%, 0.5) !important;outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important;box-shadow: none !important;}';document.head.appendChild(s)})()

OpenFaas on Google Container Engine

Setting up faas-netes cli

TODO: add this step combine with https://github.com/openfaas/faas-netes/blob/master/HELM.md

gcloud container clusters get-credentials ${CLUSTER-NAME} --zone us-central1-a --project ${PROJECT-ID}
git clone https://github.com/openfaas/faas-netes
cd faas-netes
@id0Sch
id0Sch / AsyncComponent.js
Last active September 7, 2017 11:22
AsyncComponent.js
import React, {Component} from 'react'
export default function AsyncComponent(getComponent) {
return class AsyncComponent extends Component {
static Component = null;
state = {Component: AsyncComponent.Component};
componentWillMount() {
if (!this.state.Component) {
getComponent().then(({default: Component}) => {
Math.random().toString(36).substr(2, 12)
'use strict';
const _ = require('lodash');
const members = ['ido', 'hengli', 'shir', 'eran', 'elad', 'rachel', 'maayan.Ben', 'maayan.Bat', 'igor', 'tamar', 'tal'];
const n = 6;
var chunkedArr = _.chain(members).shuffle().chunk(n).value();
setTimeout(() => {
console.log('making sure Tiki is not with ido');
setTimeout(() => {
console.log('matching good looks to skill');
setTimeout(() => {
/**
* This function compares between two version numbers formatted x.x.x...
* @param v1 - String
* @param v2 - String
* @returns {int}
* -1 if v1 is larger
* 1 if v2 is larger
* 0 if v1 & v2 are equal
*/
versionCompare: function (v1, v2) {
/**
* Created by idoschachter on 4/20/15.
*/
'use strict';
var Promise = require('bluebird');
// Helper methods
function promisify(err, data) {
return function() {
return new Promise(function(resolve, reject) {
self.dispatchInternal = function (queue, message) {
return self.connection.getQueue(queue)
.then(function (queue) {
return self.connection.sendMessageAsync({
MessageBody: JSON.stringify(message),
QueueUrl: queue.QueueUrl
});
})
.then(function (message) {
self.logger.debug(util.format("dispatched new event: %s, message Id: %s", queue, message.MessageId));
/**
* Created by idoschachter on 5/25/15.
*/
var Promise = require('bluebird');
function promiseA(){
return new Promise.resolve('a');
}