Skip to content

Instantly share code, notes, and snippets.

@reccanti
reccanti / main.html
Last active February 9, 2019 06:10
Example from the first tutorial on WebGL Fundamentals https://webglfundamentals.org/webgl/lessons/webgl-fundamentals.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>WebGL Source</title>
<style>
html {
height: 100%;
@reccanti
reccanti / stateGuessingGame.hs
Last active February 1, 2019 05:01
This is an example of how to use the State Monad in haskell
-- A game where the user tries to guess a random number
-- It initializes the game with a random number and an
-- empty array of guesses, and prompts the user to guess
-- numbers until they arrive at the correct one.
--
-- The state consists of a GameState and a Bool. The
-- GameState stores the random correct number and the
-- numbers the user has guessed. The Bool is used to
-- represent whether or not the user has guessed the
-- correct number
@reccanti
reccanti / randomNumber.hs
Last active January 29, 2019 17:51
Get a random number between 1 and 100 in Haskell
import System.Random
main = do
x <- randomRIO (1,100) :: IO Int
putStrLn $ show x
@reccanti
reccanti / counter.js
Last active July 24, 2018 21:16
Simple TODO Redux App
import React from "react";
import { createStore } from "redux";
// ACTIONS
const createIncrement = amount => ({
type: "INCREMENT",
amount
});
const createDecrement = amount => ({
@reccanti
reccanti / MyComponent.re
Created June 23, 2018 21:43
ReasonReact refs in stateless component
let component = ReasonReact.statelessComponent("MyComponent");
/**
* This will be used to hold a ref to our input element
*/
let inputRef: ref(option('a)) = ref(None);
/**
* sets the ref to the input element
*/
@reccanti
reccanti / color-palette.markdown
Created February 9, 2018 23:51
Color Palette

Color Palette

This is practice for a component I'm thinking about integrating into a blog on my personal site. I'm looking for ways to improve my art and design skills, and maybe get better at React while I'm at it. I read an article on smashing magazine that recommended trying to create a color scheme every day, so I decided to try it out for a bit!

Here's a link to the article if you're interested: Color Theory for Designers: How To Create Your Own Color Schemes

A Pen by B Wilcox on CodePen.

License.

@reccanti
reccanti / .emacs
Created January 29, 2018 11:16
Emacs Config File
(require 'package) ;; You might already have this line
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
(add-to-list 'package-archives (cons "melpa" url) t))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
@reccanti
reccanti / mnist.py
Last active May 25, 2017 02:54
The Tensorflow Getting Started Tutorials
import tensorflow as tf
# get MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
# describe a placeholder for a value
x = tf.placeholder(tf.float32, [None, 784])
# define the weights and biases
@reccanti
reccanti / introrx.md
Created March 9, 2017 01:45 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@reccanti
reccanti / git_and_unity.md
Created February 9, 2017 06:00 — forked from Ikalou/git_and_unity.md
Git and Unity

Using Git with Unity

Git logo

Git is a popular free and open source distributed version control system.

I am new to Unity, but as a long time git user, I wanted to use git for my Unity projects. The bottom line is... it doesn't work nearly as well as I would like it to.