Skip to content

Instantly share code, notes, and snippets.

View soundyogi's full-sized avatar
🦊

KaiserMerkle soundyogi

🦊
View GitHub Profile
@juhaelee
juhaelee / react-typescript.md
Last active January 26, 2023 00:52
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@alexesDev
alexesDev / main.cpp
Last active December 13, 2022 09:00
Redux c++ implementation
#include <mapbox/variant.hpp>
#include <redux.hpp>
struct Increment
{
};
struct Decrement
{
};
@mvlabat
mvlabat / ue4-building-scripts
Created September 19, 2016 11:30
Building Unreal Engine 4 MyProject from command line for Windows and Linux platforms
# Windows
Build MyProjectEditor Win64 Development "D:\Unreal\MyProject\MyProject.uproject" -waitmutex
# Linux
Build.sh MyProjectEditor Linux Development "/home/mvlabat/unreal/projects/MyProject/MyProject.uproject" -waitmutex
@drcmda
drcmda / package.json
Last active September 12, 2022 06:23
webpack 4
"scripts": {
"dev": "node .dev/webpack.dev.server.js",
"dev-prod": "node .dev/webpack.dev.server.js --production",
"build": "rimraf ./dist && webpack --config .dev/webpack.config.production.js --colors",
},
"devDependencies": {
"@babel/core": "7.0.0-beta.38",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.38",
"@babel/plugin-proposal-decorators": "7.0.0-beta.38",
"@babel/plugin-transform-classes": "7.0.0-beta.38",

Index

Preface

Together with HellMood we won this year's (2016) JS1K competition and thought this might be a good opportunity to write about the development process and my motivation behind it. If you're already familiar with JS1K, feel free to skip the next two paragraphs.

@gaearon
gaearon / reducers.js
Last active December 11, 2020 14:56
How I'd do code splitting in Redux (pseudo code, not tested!)
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});
@jaredpalmer
jaredpalmer / postinstall.js
Last active June 11, 2019 08:35
React Native Web x TypeScript
// ./postinstall.js
'use strict';
const fs = require('fs');
const RN_TSD = __dirname + '/node_modules/@types/react-native/index.d.ts';
const raw = fs.readFileSync(RN_TSD);
// Fix @types/node conflict
// @see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15960
@xgalaxy
xgalaxy / gist:6743756
Last active April 24, 2019 08:40
Example of working with anonymous types in Unity3d
using System;
using System.Collections;
using UnityEngine;
public class Testing : MonoBehaviour
{
void Start()
{
// In C#, this is an 'Anonymous Type'
// A new System.Type is generated for it at compile type
// note: I'm using redux-actions in here, so the actions might look a bit different than you are used too
// note: This is not complete but the concepts are
// excerpt from app.js
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import fetch from 'isomorphic-fetch'
// note: you could totally leave out the fetch argument here if you set a default (as I do in my actions)
// I'm right now not absolutely sure how I will handle this in the future (the way it is now it is a bit redundant)