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
Future<bool> copy(Directory source, Directory destination) async { | |
String processName = Platform.isWindows ? "robocopy" : "cp"; | |
List <String> args; | |
if (Platform.isWindows) | |
args = [source.absolute.path, destination.absolute.path, '/E', '/B']; | |
else | |
args = ['-r', source.absolute.path, destination.absolute.path]; | |
Process cp = await Process.start(processName, args); | |
cp.stdout.listen(null); // For some reason, robocopy won't copy directories unless you listen to stdout | |
stderr.addStream(cp.stderr); |
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
<link rel="import" href="/path/to/polymer/polymer.html"> | |
<dom-module id="#[[$Id$]]#"> | |
<template></template> | |
<script> | |
Polymer({ | |
is: '#[[$Id$]]#', | |
ready: function() { | |
//Do yo thang... | |
} |
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
angular.module('nba_app', []). | |
.controller('NBACtrl', NBAController) | |
.service('Hello', HelloService); |
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 Feathers from 'feathers'; | |
// ... | |
let app = Feathers(); | |
app | |
.use(compress()) | |
.options('*', cors()) | |
.use(cors()) | |
.use(BodyParser.json()) |
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
cmake_minimum_required(VERSION 3.5) | |
project(FunctionalDict) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11") | |
set(SOURCE_FILES main.cpp FunctionalDict.h) | |
add_executable(FunctionalDict ${SOURCE_FILES}) |
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 java.util.HashMap; | |
import java.util.Map; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class DiceProbability { | |
private static Random random = new Random(); | |
private static int roll(int sides) { | |
int first = random.nextInt(sides) + 1; |
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 BaseListener = require('./FooListener').FooListener; | |
function FooTranspiler() { | |
BaseListener.call(this); | |
this.output = ""; | |
} | |
FooTranspiler.prototype.enterAssignStmt = function(ctx) { | |
var target = ctx.ID().getText(); |
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 {Component, OnInit} from "@angular/core"; | |
import FooService from "foo-service.ts"; | |
@Component({ | |
selector: "my-elem", | |
templateUrl: "my-elem.html", | |
providers: [FooService] | |
}) | |
export default class MyElemCmp implements OnInit { | |
data = []; |
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
#!/usr/bin/env | |
# Run this in project root (/home/inet/app) | |
cd client && npm run build |
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
// Still run as sudo | |
var fs = require("fs"); | |
var path = require("path"); | |
var defaultFormats = []; | |
defaultFormats.push(/^(.+) (.+):([A-Fa-f0-9]+)->(.+) ([0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}) #([0-9-]+) 1 1$/); | |
defaultFormats.push(/^(.+):(.+)::(([A-Za-z0-9_]|\.|\/|\$)+)$/); | |
defaultFormats.push(/^(.+):(.+):([0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0,3}):(([A-Za-z0-9_]|\.|\/|\$)+)$/gm); |
OlderNewer