I hereby claim:
- I am tylerdiaz on github.
- I am tylerdiaz (https://keybase.io/tylerdiaz) on keybase.
- I have a public key ASCe4-xvvgZhDVIHz_7fGf56sEtXPDBVVFlK5Re3Sbe0_Ao
To claim this, I am signing this object:
const RushaClass = require('Rusha'); | |
const rusha = new RushaClass(); | |
const CONFIG = { difficulty: 3 } | |
// from: https://bitcoin.org/bitcoin.pdf | |
// and: https://www.igvita.com/2014/05/05/minimum-viable-block-chain/ | |
// I do sha1 instead of sha256 here for performance | |
class Block { |
I hereby claim:
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
from locust import HttpLocust, TaskSet, task | |
import json | |
class UserBehavior(TaskSet): | |
@task(1) | |
def index(self): | |
self.client.get(url="/") | |
class WebsiteUser(HttpLocust): |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
As developers it seems like we're in a land of plenty when it comes to code quality tools. There are many options, some more controversial than others. One such option I'd like to talk about today is the use of ESLint in Javascript with the consistent-return rule.
When you enable the consistent-return rule in ESLint the tool will automatically check that all code paths in a function either explicitly return a value or don't return a value. In functions that branch one might forget to return a value in one of the branches, and the consistent-return rule will warn you when that happens.
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
(defn square [x] | |
(* x x)) | |
(defn euclidean-distance [p q] | |
(Math/sqrt (->> (map - q p) (map square) (reduce +)))) | |
; This formula calculates the distance, which will be smaller for people who are more similar. | |
; However, you need a function that gives higher values for people who are similar. | |
; This can be done by adding 1 to the function (so you don’t get a division-by- zero error) and inverting it: |
#!/usr/bin/env php | |
<?php | |
$db_connection_favorites = array( | |
'default' => array( | |
'host' => '127.0.0.1', | |
'user' => 'root', | |
'password' => 'root', | |
'db' => 'database_name' | |
), | |
); |