Skip to content

Instantly share code, notes, and snippets.

#
# Proof of concept - import maps with JSX transpilation. Can trivially
# be extended to TypeScript and all the languages currently supported
# with Sprockets.
#
# There are two parts to this:
# * Have `find_javascript_files_in_tree` in importmap-rails to not only
# find JS files, but also files that can be transpiled to JS.
# * Add sprockets JSX transformer, making use of esbuild
#
@tylerdiaz
tylerdiaz / blockchain.es6.js
Created November 27, 2017 08:19
blockchain
const RushaClass = require('Rusha');
const rusha = new RushaClass();
const CONFIG = { difficulty: 3 }
// from: https://bitcoin.org/bitcoin.pdf
// and: https://www.igvita.com/2014/05/05/minimum-viable-block-chain/
// I do sha1 instead of sha256 here for performance
class Block {
@nickbalestra
nickbalestra / duck-on-wheels.js
Created December 28, 2016 20:51
An example of Duck Redux Reducer Bundle with Cycle.js apps to handle async
import xs from 'xstream'
import { combineCycles } from 'redux-cycle-middleware'
import { push } from 'react-router-redux'
import { API_URL } from '../constants/api'
// ACTION TYPES (Format: app-name/reducer/ACTION_TYPE)
// =======================================================
const LOGIN = 'app-name/auth/LOGIN'
const LOGIN_SUCCESS = 'app-name/auth/LOGIN_SUCCESS'
const LOGIN_FAIL = 'app-name/auth/LOGIN_FAIL'
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@mattknox
mattknox / gist:654006
Last active March 22, 2022 02:32 — forked from ryanking/gist:653962
Stop::CantTouchThis
module Stop
module CantTouchThis
def self.included(mod)
%w[instance_variable_get instance_variable_set].each do |m|
send(:protected, m)
end
eigenclass = class << mod; self; end
%w[const_set class_variable_get class_variable_set public_class_method attr attr_reader attr_writer].each do |m|