This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import Dropzone from 'react-dropzone'; | |
import { connect } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
import styles from './FileUploader.styl'; | |
import FileIcon from '../../FileIcon/index'; | |
import { | |
uploadAttachments, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
app.post('/file', (req, res, next) => { | |
let first = true; | |
req.on('data', chunk => { | |
if (!first) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = {}; | |
/*********IDENTITY**********/ | |
_.identity = function(val) { | |
return val; | |
}; | |
/*********FIRST**********/ | |
_.first = function(array, n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Event = function() { | |
var self = this; | |
self.queue = {}; | |
self.fired = []; | |
return { | |
fire: function(event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MerkleTree Implementation | |
* @version 1.0.0 | |
* @author Ronny Amarante <me@amaranter.com> | |
*/ | |
var SHA256 = require("crypto-js/sha256"); | |
function MerkleTree(transactions) { | |
this.transactions = transactions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rngstate; | |
function MathRandom() { | |
// Our own implementation of Math.random(). | |
// Source code was copied from https://github.com/v8/v8/blob/4.6.85/src/math.js#L131 | |
// You need to initialize rngstate with `solve` before this can be used. | |
// If using node.js, you have to s/18030/18273/g here and in `solve` since they implement it slightly differently: https://github.com/nodejs/node-v0.x-archive/blob/d13d7f74d794340ac5e126cfb4ce507fe0f803d5/deps/v8/src/math.js#L146 | |
console.assert(rngstate, "You need to set the global variable `rngstate` first. For example: `rngstate = solve(Math.random(), Math.random());`"); | |
if (!rngstate) return; | |
var r0 = (Math.imul(18030, rngstate[0] & 0xFFFF) + (rngstate[0] >>> 16)) | 0; | |
rngstate[0] = r0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PIXI = require('pixi.js') | |
console.log(PIXI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" standalone="no"?> | |
<application xmlns="http://ns.adobe.com/air/application/[airVersionPattern]"> | |
<filename>[fileNamePattern]</filename> | |
<id>[packagePattern]</id> | |
<name>[namePattern]</name> | |
<versionNumber>[versionNumberPattern]</versionNumber> | |
<versionLabel>[versionLabelPattern]</versionLabel> | |
<initialWindow> | |
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DEGRAD:Number = Math.PI / 180; | |
var iso:Matrix = new Matrix(); | |
iso.rotate( -45 * DEGRAD ); // rotate anti-clockwise by 45 degrees | |
iso.scale( 1.0, 0.5 ); // scale vertically by 50% | |
iso.translate( 100, 100 ); // set position if needed | |
displayObject.transform.matrix = iso; |
NewerOlder