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 person = function(firstName, lastName) { | |
return { | |
getFullName: function() { | |
return firstName + ' ' + lastName; | |
}, | |
setFirstName: function(newName) { | |
firstName = newName; | |
}, | |
setLastName: function(newName) { |
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 fs = require('fs'); | |
var path = require('path'); | |
var recurseDir = function(dir) { | |
fs.readdirSync(dir).forEach(function(child) { | |
if (child[0] != '.') { | |
var childPath = path.join(dir, child); | |
if (fs.statSync(childPath).isDirectory()) { | |
recurseDir(childPath); | |
} else { |
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 fs = require('fs'); | |
var path = require('path'); | |
var Q = require('q'); | |
var interrupt = require('./interrupt.js'); | |
var readdir = interrupt.bind(Q.nfbind(fs.readdir)); | |
var stat = interrupt.bind(Q.nfbind(fs.stat)); | |
var consoleLog = interrupt.bind(console.log); | |
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
Test.foo(v => v > 5); |
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
function listenTo(target, notify) { | |
var proxy = {}; | |
Object.keys(target).forEach(function(methodName) { | |
var targetMethod = target[methodName].bind(target); | |
proxy[methodName] = function() { | |
var args = Array.prototype.slice.call(arguments); |
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
using System; | |
using System.Collections.Specialized; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
namespace WikiBackup | |
{ | |
class Program |
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
interface Person { | |
readonly name?: string; | |
readonly age?: number; | |
} | |
const x = record<Person>({ name: "Bart" }).set({ age: 10 }); | |
const y = x.set({ age: 11 }); |
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 { autorun } from "mobx"; | |
import { createStore, Action, Reducer } from "./remox" | |
interface Person { firstName: string; lastName: string; } | |
interface SetFirstName { type: "SET_FIRST_NAME", newFirstName: string; } | |
interface SetLastName { type: "SET_LAST_NAME", newLastName: string; } | |
function personReducer(state:Person, action: SetFirstName | SetLastName) { |
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
namespace Cudo | |
{ | |
public class CudoEvent<TRecord> | |
{ | |
public CudoEvent(CudoEventType type, TRecord record) | |
{ | |
Type = type; | |
Record = record; | |
} |
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 from 'react'; | |
function twoWay(Comp) { | |
return props => { | |
const { value, children, ...others } = props; | |
return ( | |
<Comp {...others} |
OlderNewer