This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
$ sudo -i | |
# cd /dev | |
# rm random | |
# mknod /dev/random c 1 9 | |
# cat /dev/random |
This file contains hidden or 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> | |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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)) |