Skip to content

Instantly share code, notes, and snippets.

Val thevaleriemack

Block or report user

Report or block thevaleriemack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thevaleriemack
thevaleriemack / 1_apolloClient.js
Last active Dec 20, 2018
Apollo Redux Super Fast
View 1_apolloClient.js
/*
3 Easy steps to get Apollo and Redux to play nicely super fast.
Configure the Apollo client
*/
import { ApolloClient } from 'apollo-client';
import { createHttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory';
@thevaleriemack
thevaleriemack / dateTime.js
Created Nov 23, 2018
Lightest way to get the date and time in the format you want
View dateTime.js
const getTodayDefault = () => {
return new Date().toDateString();
}
const getTodayCondensed = () => {
return new Date().toLocaleDateString();
}
const getTodayExpanded = () => {
let d = new Date();
@thevaleriemack
thevaleriemack / mongo_shell_cheat_sheet.md
Last active Sep 22, 2018
mongo commands I need to know
View mongo_shell_cheat_sheet.md

Connect to mongo

$ mongo

What db am I in?

> db

What dbs do I have?

@thevaleriemack
thevaleriemack / single_threaded_rust_server.rs
Created Aug 17, 2018
Single threaded Rust server from the Rust Programming Language 2018 book
View single_threaded_rust_server.rs
use std::io::prelude::*; // Traits that let us read and write to the stream
use std::net::TcpStream;
use std::net::TcpListener;
use std::fs; // Bring standard library File into scope
fn main() {
// bind returns a new TcpListener instances
// Connecting to a port to listen to is also called "binding to a port"
// bind returns a Result<T, E>
// unwrap will stop the program if errors occur
@thevaleriemack
thevaleriemack / soma_pizza.rs
Created Aug 17, 2018
Order pizza for your SF meetup! aka my first Rust program
View soma_pizza.rs
use std::io;
fn main() {
println!("How many RSVPS do you have for your Meetup?");
let mut input = String::new();
io::stdin().read_line(&mut input)
.expect("Failed to read input.");
let trimmed = input.trim();
@thevaleriemack
thevaleriemack / popchain.js
Created May 27, 2018
node.js blockchain implementation
View popchain.js
const SHA256 = require('crypto-js/sha256');
const cryptoRandomString = require('crypto-random-string');
class Block {
constructor(data) {
this.nonce = 0;
this.data = data;
this.previousHash = '';
this.timeCreated = Date.now(); //+ performance.now();
this.hash = this.calculateHash();
View keybase.md

Keybase proof

I hereby claim:

  • I am thevaleriemack on github.
  • I am valem (https://keybase.io/valem) on keybase.
  • I have a public key ASCj43LXL9KEED57fY3H9ljGKMcV71VFg02By4XmVxLI4wo

To claim this, I am signing this object:

You can’t perform that action at this time.