Skip to content

Instantly share code, notes, and snippets.

View tzookb's full-sized avatar

Tzook Bar Noy tzookb

View GitHub Profile
@tzookb
tzookb / webpack.config.js
Created July 26, 2018 08:49
my webpack config that breaks => "html-webpack-plugin"
const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin')
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
const resolveBowerPath = function(componentPath) {
return path.join(__dirname, 'bower_components', componentPath);
@tzookb
tzookb / react-hoc.js
Created June 20, 2018 10:25
some games with react higher order component
import React from 'react';
import PropTypes from 'prop-types';
import BaseModalDialog from './../../Popups/BaseModalDialog';
import CircleIcon from './../../../utils/icons/CircleIcon';
import DynamicTitle from '../common/DynamicTitle'
const addModalHolder = WrappedComponent => {
return props => {
return (
@tzookb
tzookb / main.go
Created December 7, 2017 21:46
Go Hello World :) super simple
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello World %s!", r.URL.Path[1:])
}
@tzookb
tzookb / example.js
Created June 19, 2017 06:17
react native image full width
<Image
source={require('../assets/sunset-hands-love-woman.jpg')}
resizeMode="cover"
style={{
width: undefined,
height: undefined,
flex: 1,
backgroundColor: "pink"
}}
/>
@tzookb
tzookb / webtask.js
Created May 22, 2017 11:38
Auth0 application form
const Twilio = require('twilio@2.2.1');
const Slack = require('slack-notify@0.1.4');
module.exports = function(context, cb) {
const twilioAccount = context.secrets.twilioAccount;
const twilioToken = context.secrets.twilioToken;
const slackWebhook = context.secrets.slackHook;
var slack = require('slack-notify')(slackWebhook);
@tzookb
tzookb / main.js
Created May 15, 2017 16:31
higher Order Components - HOC
reasons to use HOC
- overide props
const User = (props) => {
<div>{props.name}</div>
}
const hoc (BaseComponent) => (props) => {
<BaseComponent {...props} />
@tzookb
tzookb / auth0.js
Created April 25, 2017 12:37
small script for WebTask.io that returns a single giphy depends on the query you send.
var request = require('request');
module.exports =
function (context, req, res) {
var limit = 1;
var giphyToken = "dc6zaTOxFJmzC";
var query = context.data.q;
if (!query || query==="") {
@tzookb
tzookb / learn-advanced-javascript.md
Last active February 10, 2017 10:26
learn advanced javascript

meeting 1

loved the the way he explains the compilation process the the differences between left side and right side.

meeting 2

learned a new phrase for something I used before an IIFE. Always use let, but now I really understand what it does, and how it hijacks the current block scope.

meeting 3

FROM nginx:1.9-alpine
MAINTAINER Tomaz Zaman
RUN mkdir -p /var/www/html
WORKDIR /var/www/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY . ./
@tzookb
tzookb / sol.js
Created October 18, 2016 11:47
Chaser quick question
var data = [
{name: "xavier", rank: 2},
{name: "avi", rank: 5},
{name: "oz", rank: 1},
{name: "mom", rank: 1},
{name: "dad", rank: 3}
];
function rankOrder(data) {
return data.sort(function(a, b) {