Skip to content

Instantly share code, notes, and snippets.

View RJ-software-outsourcing's full-sized avatar
🔨
We provide professional software outsourcing service

RJ Software Outsourcing RJ-software-outsourcing

🔨
We provide professional software outsourcing service
View GitHub Profile

Here's a quick way to start a typescript project:

npx create-react-app demo-app --template typescript
  • TypeScript is a superset of JavaScript
  • Before execution, TypeScript code will be compiled to JavaScript (by TypeScript compiler)
  • TypeScript compiler is written in TypeScript!

Pros

(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({"/Users/chenwei/Desktop/github/metamask-extension/app/scripts/createStandardProvider.js":[function(_dereq_,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _promise = _dereq_('babel-runtime/core-js/promise');
var _promise2 = _interopRequireDefault(_promise);
pragma solidity ^0.5.1;
contract Test {
function getRand() view public returns (uint8, uint8, uint8, uint8) {
uint256 t = rand;
bytes memory bb = toBytes(t);
return (toUnit(bb[7]), toUnit(bb[15]), toUnit(bb[23]), toUnit(bb[31]));
}
class Node {
constructor(value) {
this.value = value;
}
insert(insertedValue) {
if (insertedValue > this.value) {
if (this.right) {
this.right.insert(insertedValue);
@RJ-software-outsourcing
RJ-software-outsourcing / blank template
Last active January 6, 2019 07:11
Blank template for Election
pragma solidity ^0.4.25;
contract Election {
address owner; // Address of the contract owner
bool public isVoting = false; // isVoting should be true when voting starts
uint public round = 0; // round number should be increased when new election starts
struct Candidate {
uint vote;