Skip to content

Instantly share code, notes, and snippets.

@innovid-rnd
innovid-rnd / create_chef_cluster.sh
Created August 30, 2017 08:47
Creating a highly-available Chef cluster with 3 backends and 2 frontends in an AWS VPC
#!/bin/bash -l
set -e -x -u
# Below is a script to create and configure the chef cluster, provided as a reference and documentation for the steps.
# The steps are documented in the chef cluster docs: https://docs.chef.io/install_server_ha.html
# Created by Innovid.com
region=$1
if [ -z "${region}" ]; then
echo "Please specify a region"
exit 1
@innovid-rnd
innovid-rnd / chef_cluster_sgs.yml
Created September 4, 2017 19:22
YAML with chef-cluster security group configuration
security_groups:
- name: chef-alb
egress_entries:
- ip_protocol: TCP
from_port: '443'
to_port: '443'
source_security_group: chef-frontend
ingress_entries:
- ip_protocol: TCP
@innovid-rnd
innovid-rnd / GenerateTags.tsx
Created March 6, 2018 12:19
Injecting the redux form reducer on the GenerateTags component load
public componentDidMount() {
const reduxFormReducer = require("redux-form").reducer;
injectAsyncReducer(store, "form", reduxFormReducer);
}
@innovid-rnd
innovid-rnd / configureStore.ts
Created March 6, 2018 12:21
Configuring the redux store and Injecting Async Redux Reducers
export function injectAsyncReducer(store, name, asyncReducer) {
if (store.asyncReducers[name]) {
return;
}
store.asyncReducers[name] = asyncReducer;
store.replaceReducer(createReducer(store.asyncReducers));
}
export const configureStore = (initialState: AppState) => {
const enhancer = compose(applyMiddleware(...getMiddleware()));
@innovid-rnd
innovid-rnd / combineReducers.tsx
Created March 6, 2018 12:22
adding redux form reducer to our app reducers
import { reducer as formReducer } from "redux-form";
const applicationReducer: Reducer<any> = combineReducers({
user,
sidenav,
navigation,
//...
form: formReducer
});
@innovid-rnd
innovid-rnd / webpack.js
Created March 6, 2018 12:23
webpack 4 loading vendors into vendor.js and generating a manifest file which includes the webpack runtime
mode: "production",
entry: {
app: path.join(__dirname, "index.tsx"),
},
output: {
path: path.resolve(__dirname, "public/dist"),
publicPath: "",
chunkFilename: "[name].js",
filename: "[name].js"
},
@innovid-rnd
innovid-rnd / tsconfig.json
Created March 6, 2018 12:24
tsconfig for dynamic imports
{
"compilerOptions": {
"target": "es5",
"sourceMap": false,
"inlineSourceMap": true,
"module": "esnext",
"moduleResolution": "node",
"jsx": "react",
"preserveConstEnums": true,
"removeComments": false,
@innovid-rnd
innovid-rnd / LazyGenerateTags.tsx
Created March 6, 2018 12:25
Using React Loadable for lazy loading our GenerateTags component
const GenerateTags = Loadable({
loader: () =>
import(/* webpackChunkName: "generateTags" */ "./GenerateTags"),
loading: LoadingSpinner
});
class HelloWorld < Formula
desc "usefull script that prints Hello World to your Console"
homepage "https://bitbucket.org/user/repo"
def self.get_file_as_str(str)
return (File.read File.expand_path(str)).rstrip
end
url "https://#{get_file_as_str("~/git_user")}:#{get_file_as_str("~/git_password")}@bitbucket.org/user/repo/get/HEAD.zip", :using => :curl
class HelloWorld < Formula
desc "usefull script that prints Hello World to your Console"
homepage "https://bitbucket.org/user/repo"
url "https://bitbucket.org/user/repo/get/HEAD.zip", :using => :curl
def install
bin.install "innovid/hello-world"
end