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 pipeline = { | |
mapping: {}, | |
respond: (regex, func) => { | |
this.mapping = this.mapping || {} | |
this.mapping[regex.source] = func | |
}, | |
hear: (regex, func) => { | |
this.mapping = this.mapping || {} | |
this.mapping[regex.source] = func | |
}, |
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.io.File; | |
import java.io.IOException; | |
import java.util.Scanner; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class XmlInColorsConverter { | |
private static final Pattern NAME = Pattern.compile("(?:([a-zA-Z][a-zA-Z0-9]+):)?([a-zA-Z][a-zA-Z0-9._]+)"); |
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
/* imports */ | |
const webpack = require('webpack') | |
const path = require('path') | |
const fs = require('fs') | |
const unzip = require('unzip2')/* imports */ | |
const webpack = require('webpack') | |
const path = require('path') | |
const fs = require('fs') | |
const unzip = require('unzip2') | |
const mkdirp = require('mkdirp') |
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
package foo.bar.config; | |
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.web.client.RestTemplate; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.TrustManager; |
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 com.mycompany.mymodel.Phone; | |
import com.google.i18n.phonenumbers.NumberParseException; | |
import com.google.i18n.phonenumbers.PhoneNumberUtil; | |
import com.google.i18n.phonenumbers.Phonenumber; | |
import java.util.Locale; | |
import java.util.stream.Collectors; | |
import org.apache.commons.lang3.StringUtils; | |
import static com.mycompany.mymodel.Phone.phone; |
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
public class TestExtendConsumer { | |
@FunctionalInterface public interface NumberConsumer<E extends Number> extends java.util.function.Consumer<E>{void accept(E number);} | |
private static <E extends Number> void extend(E number) { | |
System.out.println(number); | |
} | |
public static void main(String[] args) { | |
NumberConsumer numberConsumer = TestExtendConsumer::extend; |
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 benchmark = ({theContestants, howManyTimes, forThisWork, barSettings, asText, logInConsole, seedInit}) => { | |
const timestamp = () => { | |
const hrTime = process.hrtime(); | |
return hrTime[0] * 1000000 + hrTime[1] / 1000 | |
} | |
const asNumbers = (name, duration) => `[${name.padStart(20)}]: ${`${(duration).toFixed(5)}`.padStart(15)} µs, ${`${((duration) / 1000).toFixed(0)}`.padStart(5)} ms, ${`${((duration) / 1000000).toFixed(2)}`.padStart(5)} s` | |
const asBar = (between0And1, histogramDisplay = barSettings) => { | |
const peak = between0And1 * histogramDisplay.width | |
const interval = histogramDisplay.width / histogramDisplay.gradient.length |
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 {get} = require('axios') | |
const unzip = require('yauzl') | |
const eventStream = require('event-stream') | |
const keys = { | |
agency: ['agency_id'], | |
stops: ['stop_id'], | |
calendar: ['service_id'], | |
calendar_dates: ['date', 'service_id'], | |
routes: ['route_id'], |
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
{ | |
"name": "yamlchecker", | |
"version": "0.0.1", | |
"private": true, | |
"dependencies": { | |
"yamljs": "latest" | |
}, | |
"devDependencies": { | |
"webpack": "latest" | |
} |