Skip to content

Instantly share code, notes, and snippets.

View scissorsneedfoodtoo's full-sized avatar

Kristofer Koishigawa scissorsneedfoodtoo

View GitHub Profile
var denom = [
{ name: 'ONE HUNDRED', val: 100 },
{ name: 'TWENTY', val: 20 },
{ name: 'TEN', val: 10 },
{ name: 'FIVE', val: 5 },
{ name: 'ONE', val: 1 },
{ name: 'QUARTER', val: 0.25 },
{ name: 'DIME', val: 0.1 },
{ name: 'NICKEL', val: 0.05 },
{ name: 'PENNY', val: 0.01 },
@scissorsneedfoodtoo
scissorsneedfoodtoo / disable middle click paste in linux.md
Created January 17, 2019 11:05 — forked from sam0x17/disable middle click paste in linux.md
disable middle-click paste in linux without disabling middle scroll

Disable middle-click paste in Linux

Install packages:

sudo apt-get install xbindkeys xsel xdotool

Create xbindkey configuration file:

# ~/.xbindkeysrc
@scissorsneedfoodtoo
scissorsneedfoodtoo / pr.md
Created January 23, 2019 23:43 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@scissorsneedfoodtoo
scissorsneedfoodtoo / bumpFiles.js
Last active April 11, 2019 13:34
Automatically create the next challenge files for freeCodeCamp's new curriculum
const fs = require('fs');
const rootDir = './';
const cssDir = './css/';
function bumpFile(dir) {
const files = fs.readdirSync(dir);
let lastFile;
for (let i = files.length - 1; i > 0; i--) {
const file = files[i];
@scissorsneedfoodtoo
scissorsneedfoodtoo / index.js
Created April 29, 2019 04:31
playing with HKuz's world map tooltip
// Set up tooltip
const tooltip = d3.select("#tooltip")
.style("display", "none")
.classed("tooltip", true);
// Draw the map and add tooltip functionality
g.selectAll(".countries")
.data(countries)
.enter().append("path")
.attr("class", "countries")
@scissorsneedfoodtoo
scissorsneedfoodtoo / index.js
Last active May 8, 2019 05:44
Tried to tidy up karuppiah7890's view counter
const MockXMLHttpRequest = require('mock-xmlhttprequest');
const server = MockXMLHttpRequest.newServer({
get: ['/views', function (xhr) {
let count = 0;
if (typeof (Storage) !== "undefined") {
count = Number(localStorage.getItem("count"));
} else {
console.log('Sorry! No Web Storage support for this browser. This web page will not function properly');
}
import random
class Card:
def __init__(self, suit, rank):
self.suit = suit
self.rank = rank
def __str__(self):
return f"{self.rank['rank']} of {self.suit}"
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Last active August 11, 2020 07:14
Advanced Node and Express - Set up Passport
'use strict';
require('dotenv').config();
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const ObjectID = require('mongodb').ObjectID;
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Last active August 11, 2020 07:14
Advanced Node and Express - Implement the Serialization of a Passport User
'use strict';
require('dotenv').config();
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const ObjectID = require('mongodb').ObjectID;
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
@scissorsneedfoodtoo
scissorsneedfoodtoo / server.js
Last active August 11, 2020 07:13
Advanced Node and Express - How to Use Passport Strategies
'use strict';
require('dotenv').config();
const express = require('express');
const session = require('express-session');
const passport = require('passport');
const LocalStrategy = require('passport-local');
const ObjectID = require('mongodb').ObjectID;
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');