Skip to content

Instantly share code, notes, and snippets.

View oreillyross's full-sized avatar
🏠
Working from home

Faktor 10 oreillyross

🏠
Working from home
View GitHub Profile
@oreillyross
oreillyross / index.html
Last active July 28, 2020 12:50
JS Bin// source https://jsbin.com/kawusad Fibannaci using generator function
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blissfuljs/1.0.2/bliss.min.js"></script>
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
let g:auto_save = 1
set relativenumber
@oreillyross
oreillyross / .env
Last active May 7, 2019 13:13
This can be added to create-react-apps using Cloud 9 (for hot reloading)
CHOKIDAR_USEPOLLING=true
@oreillyross
oreillyross / .gitignore
Created September 30, 2016 09:50
Baseline git ignore file for node projects
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
{
"name": "react-app",
"version": "1.0.0",
"description": "react application",
"scripts": {
"build": "browserify ./src/app.jsx -o ./public/app.js -t babelify",
"watch": "watchify ./src/app.jsx -o ./public/app.js -t babelify -v"
},
"dependencies": {
"babel-preset-es2015": "6.9.0",
@oreillyross
oreillyross / image_loader_function.js
Last active June 1, 2016 10:45
A MULTIPLE IMAGE LOADER THAT COUNTS THE LOADED IMAGES AND CALLS A FUNCTION YOU PASS WHEN DONE!
function loadImages(imagesToBeLoaded, drawCallback) {
var imagesLoaded = {};
var loadedImages = 0;
var numberOfImagesToLoad = 0;
// get num of images to load
for(var name in imagesToBeLoaded) {
numberOfImagesToLoad++;
}
for(var name in imagesToBeLoaded) {
imagesLoaded[name] = new Image();
@oreillyross
oreillyross / image_loader_function.js
Created June 1, 2016 10:44
A MULTIPLE IMAGE LOADER THAT COUNTS THE LOADED IMAGES AND CALLS A FUNCTION YOU PASS WHEN DONE!
function loadImages(imagesToBeLoaded, drawCallback) {
var imagesLoaded = {};
var loadedImages = 0;
var numberOfImagesToLoad = 0;
// get num of images to load
for(var name in imagesToBeLoaded) {
numberOfImagesToLoad++;
}
for(var name in imagesToBeLoaded) {
imagesLoaded[name] = new Image();
@oreillyross
oreillyross / Chessboard.js
Last active June 1, 2016 10:37
Draw a chessboard on canvas object using new HTML5 api
// n = number of cells per row/column
function drawCheckboard(n) {
grdFrenchFlag = ctx.createLinearGradient(0, 0, 300, 200);
grdFrenchFlag.addColorStop(0, "blue");
grdFrenchFlag.addColorStop(0.5, "white");
grdFrenchFlag.addColorStop(1, "red");
ctx.fillStyle = grdFrenchFlag;
var l = canvas.width;
function checkCashRegister(price, cash, cid) {
var change = cash - price;
console.log('change: ' + change);
var cashInDrawer = function() {
var tot = 0;
cid.forEach(function(curr) {
tot = tot + curr[1]
// console.log(curr[1])