Skip to content

Instantly share code, notes, and snippets.

View zabirauf's full-sized avatar
👨‍💻
I may be slow to respond.

Zohaib Rauf zabirauf

👨‍💻
I may be slow to respond.
View GitHub Profile
@zabirauf
zabirauf / gulpfile.js
Created October 19, 2015 00:11
Gulpfile for a frontend in React + ES6
var gulp = require('gulp'),
gutil = require('gulp-util'),
babelify = require('babelify'),
source = require('vinyl-source-stream'),
browserify = require('browserify'),
watchify = require('watchify'),
browserSync = require('browser-sync').create();
var paths = {
HTML: 'src/index.html',
function append(arrOrNum, toAppendArrOrNum) {
if (!Array.isArray(arrOrNum)) {
arrOrNum = [arrOrNum];
}
if (!Array.isArray(toAppendArrOrNum)) {
toAppendArrOrNum = [toAppendArrOrNum];
}
return arrOrNum.concat(toAppendArrOrNum);
function append(
arrOrNum: number | number[],
toAppendArrOrNum: number | number[]): number[] {
if (!Array.isArray(arrOrNum)) {
arrOrNum = [arrOrNum];
}
if (!Array.isArray(toAppendArrOrNum)) {
toAppendArrOrNum = [toAppendArrOrNum];
interface TrafficLight {
red: boolean;
yellow: boolean;
green: boolean;
}
function nextTrafficLightState(
trafficLight: TrafficLight): TrafficLight {
if (trafficLight.red && trafficLight.yellow) {
type TrafficLightState =
{ red: true, yellow: false, green: false } |
{ red: true, yellow: true, green: false } |
{ red: false, yellow: false, green: true } |
{ red: false, yellow: true, green: false }
function nextTrafficLightState(
trafficLight: TrafficLightState): TrafficLightState {
if (trafficLight.red && trafficLight.yellow) {

Keybase proof

I hereby claim:

  • I am zabirauf on github.
  • I am zabirauf (https://keybase.io/zabirauf) on keybase.
  • I have a public key ASARuUOjzzy29X8HMZTWPwaznADwtY2m8LXL_HshE-64-Ao

To claim this, I am signing this object:

// Code for StringToUintMap.sol
pragma solidity ^0.4.15;
library StringToUintMap {
struct Data {
mapping (string => uint8) map;
}
function insert(
// Code for PersonsAge.sol
pragma solidity ^0.4.15;
import { StringToUintMap } from "../libraries/StringToUintMap.sol";
contract PersonsAge {
StringToUintMap.Data private _stringToUintMapData;
const StringToUintMap = artifacts.require("./StringToUintMap.sol");
const PersonsAge = artifacts.require("./PersonsAge.sol");
module.exports = function(deployer) {
deployer.deploy(StringToUintMap);
deployer.link(StringToUintMap, PersonsAge);
deployer.deploy(PersonsAge);
};
module.exports = {
networks: {
development: {
host: "localhost", // Ganache RPC server URL
port: 7545, // Ganache RPC server Port
network_id: "*" // Match any network id
}
}
};