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 ReadonlyArray<T> { | |
map<U>( | |
callbackfn: (value: T, index: number, array: T[]) => U, | |
thisArg?: any | |
): { [K in keyof this]: U }; | |
} | |
type Coord = readonly [number, number, number]; | |
type BiFunction<T> = (a: T, b: T) => T; |
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 aiohttp | |
import asyncio | |
import time | |
from pyspark.sql import SparkSession | |
from pyspark.sql.functions import col, collect_list,udf | |
spark = SparkSession.builder.getOrCreate() | |
data = range(1, 10000) | |
df = spark.createDataFrame([(i,) for i in data], ["value"]) | |
grouped_df = ( |
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
from pyspark.sql import SparkSession | |
from pyspark.sql.types import StringType | |
from pyspark.sql.functions import col, udf, collect_list, size, length | |
spark = SparkSession.builder.getOrCreate() | |
def alpha_sort(word): | |
return "".join(sorted(word)) |
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 { Instant } from '../types'; | |
type NotificationType = 'po-approval' | 'program-activation'; | |
interface NotificationSharedFields { | |
referenceId: string; | |
message: string; | |
seen: boolean; | |
createdAtUtc: Instant; | |
notificationType: NotificationType; |
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
if ($host.Name -eq 'ConsoleHost') { | |
Set-PSReadLineOption -EditMode Emacs | |
Set-PSReadlineOption -BellStyle None | |
} | |
# Ensure that Get-ChildItemColor is loaded | |
Import-Module Get-ChildItemColor | |
# Set l and ls alias to use the new Get-ChildItemColor cmdlets | |
Set-Alias ll Get-ChildItemColor -Option AllScope | |
Set-Alias ls Get-ChildItemColorFormatWide -Option AllScope |
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 versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: "canary", |
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
it('delete me', async (done) => { | |
const addAll = nums => nums.reduce((a, b) => a + b, 0); | |
const o1 = Observable.of(1); | |
const o2 = Observable.of(2).delay(1000).shareReplay(1); | |
const o1p2 = Observable.forkJoin([o1, o2]).pipe( | |
map(addAll), | |
shareReplay(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
exports.handler = async (event, ctx, callback) => { | |
console.log({app:"unknown", env: "unknown", ...(JSON.parse(event.body))}); | |
var response = { | |
"statusCode": 200, | |
"body": JSON.stringify({result:"ok"}), | |
"isBase64Encoded": false | |
}; | |
callback(null,response); | |
}; |
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 chris.impl; | |
import java.util.Comparator; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.function.Function; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; | |
import java.util.stream.StreamSupport; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title> - jsFiddle demo</title> | |
<style type='text/css'> | |
</style> | |
NewerOlder