Skip to content

Instantly share code, notes, and snippets.

View radekstepan's full-sized avatar

Radek Stepan radekstepan

View GitHub Profile
this.ycQuestions = [
"So what are you working on?",
"Have you raised funding?",
"What makes new users try you?",
"What competition do you fear most?",
"What’s the worst thing that has happened?",
"Will you reincorporate as a US company?",
"What’s an impressive thing you have done?",
"Where is the rocket science here?",
"Why did you pick this idea to work on?",
@Avaq
Avaq / combinators.js
Last active March 18, 2024 20:49
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@avimoondra
avimoondra / index.html
Last active August 27, 2020 23:32
Probability Tree
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
</head>
<body>
<style type="text/css">

Experimental Generation of Interpersonal Closeness

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should

@skeggse
skeggse / crypto-pbkdf2-example.js
Last active April 17, 2024 21:04
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
@paton
paton / simple.js
Last active October 7, 2019 16:14
Super simple implementation of define() and require() used in Localize.js (https://localizejs.com)
var define, require;
(function() {
var modules = {};
require = function(name) {
return modules[name]();
};
define = function(name, fn) {
@rjz
rjz / stdin-and-fs-stream.js
Created March 12, 2014 05:18
Streaming from stdin or a file
// Depends on `through`
//
// $ npm install through
//
// Usage:
//
// $ echo 'hello' | node stdin-and-fs-stream.js
// $ echo 'hello' > tmp && node stdin-and-fs-stream.js tmp
//
var fs = require('fs'),
@jamlfy
jamlfy / balance.js
Last active December 26, 2015 13:29
To balance clustered nodejs actually generates greater stability
const cluster = require('cluster');
const http = require('http');
const httpProxy = require('http-proxy');
const _ = require('underscore');
var numCPUs = 10;
var isPort = 8080;
function estimatePi() {
var n = 10000000, inside = 0, i, x, y;
@desandro
desandro / bower-logo.md
Last active December 30, 2021 23:11
Bower logo

In addition to awesome docs #228, Bower deserves a proper logo. See below for sketches. I'm curious if you think any of these are worth me putting more effort into.


Take a look at Yeoman right now.

Screen Shot 2013-02-19 at 4 43 10 PM

The other two entities have awesome logos. Bower's got to represent.

@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;