Skip to content

Instantly share code, notes, and snippets.

@achadha235
achadha235 / webpack.config.js
Created February 4, 2017 20:01
Webpack 2.0 Rules Configuration
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
const webpack = require('webpack'); //to access built-in plugins
var path = require('path');
module.exports = {
entry: './src/mebot.jsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'mebot.bundle.js',
},
@achadha235
achadha235 / awesome_blogs.txt
Last active November 29, 2017 19:53
Informative blog posts I read
Tech
CS
-https://www.cs.cmu.edu/~scandal/nesl/algorithms.html - Parallel algorithms
Web
- https://www.html5rocks.com/en/tutorials/internals/howbrowserswork/#The_browser_high_level_structure
- https://ocalog.com/user/1/
iOS
- http://blog.stablekernel.com/ios-build-configurations-and-schemes/ About iOS build configurations and schemas
- http://browniefed.com/blog/react-native-how-to-bridge-an-objective-c-view-component/ React native UI modules guide
@achadha235
achadha235 / searchtrie.js
Last active June 15, 2019 19:44
Simple Search Tries in ES6
/*
TRIES
A trie (or radix tree) is a simple data structure that represents a set of values stored against a
tokenizable key (usually strings). Each edge in a Trie represents a token in a key. A key is present in the trie if
(1) There exists a path (e1..en) from the root such that the key = <token(e1), token(e2)...token(en)> and
(2) there is some value at the path's terminal vertex vn.
Let k = length(key). Then time complexity for lookup, insertion and deletion for a Trie is O(k).
@achadha235
achadha235 / createReducer.js
Last active May 30, 2017 15:06
Basic App reducer
export default function createReducer(initialState, handlers) {
return function reducer(state = initialState, action) {
if (handlers.hasOwnProperty(action.type)) {
return handlers[action.type](state, action);
} else {
return state;
}
}
}
curl -X POST \
'https://graph.facebook.com/v2.6/me/messages?access_token=EAAERtp903I8BAFZCKgmcp0socMBdXowME2tQYnkJRV0rVzA1Se7K7TY91QZBm75gWfg2ESEffAahxLq1rwfwNjvpT3eWh1Im6LVtoZClXD6ork0SZAaRzeMcDpfdw4UrsU8hVEFBaIITuL5mnFcHU5JzWkUqDE63B1CZCm4lwwgZDZD' \
-H 'content-type: application/json' \
-d '{
"recipient":{
"id":"1367137299990419"
},
"message":{
"attachment":{
"type":"template",
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Setting up your own private and secure VPN. You can read instructions on our blog https://www.webdigi.co.uk/blog/2015/how-to-setup-your-own-private-secure-free-vpn-on-the-amazon-aws-cloud-in-10-minutes/ and you can follow video instructions on Youtube https://www.youtube.com/watch?v=fBBERp5CUgo",
"Parameters": {
"Username": {
"Description": "VPN Username",
"Type": "String",
"MinLength": "1",
"MaxLength": "255",
"AllowedPattern": "[a-zA-Z][a-zA-Z0-9]*",
@achadha235
achadha235 / study-group.md
Last active January 18, 2019 19:35
Kubernetes ConfigMaps - Backend Study Group 1/18

ConfigMaps and Secrets

Often times you have many different containers with shared environment environment variables and secrets. Ideally, we want to keep DRY and declare our environment variables only once securely and use them wherever needed. The SecretEnvSource and ConfigMapEnvSource APIs let you do this for your containers.

According to the Kubernetes docs:

ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.

I guess ConfigMaps are just maps for configuration...

@achadha235
achadha235 / docker-kube-tutorial.md
Created January 21, 2019 19:13
30 Second Docker / Kubernetes Tutorial

Working with Kubernetes, Docker and Google Cloud

Requirements

  • docker and kubectl set up
  • a working Dockerfile within a project
  • a Google Cloud Container registry
  1. Build a docker image locally

    docker build -t cryptokitties-api-abhi .

@achadha235
achadha235 / game-design.md
Last active March 7, 2019 22:11
Meeting planning

๐Ÿ“ Pre meeting checklist:

  • You thought through the situation and believe a meeting a necessary. If not, think about why you need this meeting in the first place.

  • You need outside input to make progress. If not, schedule time for doing this work.

  • Moving forward requires a real-time conversation If not, send an email or use Slack.

๐Ÿ—“๏ธ Game Design Meeting

We're going to meet for an hour every week to go over active and new game ideas. We'll spend the first half of the meeting on new ideas and the rest of the time on existing ideas. Bring new games!

@achadha235
achadha235 / try-me.js
Created March 12, 2019 03:38
Webauthn
var createChallenge = () => window.crypto.getRandomValues(new Uint8Array(32)).buffer;
var createUserId = () => new Uint8Array(16);
var credential;
var attestation;
var assertion;
var createCredentialDefaultArgs = {
publicKey: {
rp: { name: "Dapper" },