Skip to content

Instantly share code, notes, and snippets.

View fielding's full-sized avatar
🙊

Fielding Johnston fielding

🙊
View GitHub Profile
function getPageName(url) {
var index = url.lastIndexOf("/") + 1;
var filenameWithExtension = url.substr(index);
var filename = filenameWithExtension.split(".")[0];
return filename;
}
var url = window.location.href;
var fileName = getPageName(url);
@fielding
fielding / store.js
Created October 30, 2019 02:50
blah
// this is @Lukeed's 'sublet' with some small changes to allow for automatic dependency tracking as well as
// explicit registering of change effects
// prob should use a weakMap for these
const reactionsMap = {};
const contextMap = {};
let ctx;
export const setContext = id => {
ctx = id;

QA Tasks

complete

  • multiple timer events on promo cards
  • screen from wallet to profile doing that weird dance
  • wallet graph being visible on the profile screen
  • graph date selectors being visible when transactions are extended ( that is actually according to the mockup, but I had planned to fix that)
  • smooth out transactions extending thing
const Info = ({ title, img, alt, message, details, className, buttonText = 'Done', handleClick = () => {} }) => (
<div className={className !== undefined ? `${styles['acc__info']} ${styles[className]}` : styles['acc__info']}>
<h2>{title}</h2>
<div className={styles.card}>
<div className={styles['acc__info__container']}>
<img src={img} alt={alt} />
</div>
<h4>{message}</h4>
<p>{details}</p>
</div>
[
{
"name": "Chongqing",
"country": "China",
"displayName": "Chongqing (China)"
},
{
"name": "Shanghai",
"country": "China",
"displayName": "Shanghai (China)"
/**
*
* Node
*
* @param {*} key
* @param {*} value
* @param {Node} [next=null]
* @param {Node} [prev=null]
*/
function Node(key, value, next = null, prev = null) {

Repo

Haven't decided if I am going to submit code to it yet

Questions

👍 - Unlocked & Done 😊 - Locked & Done 🔒 - Locked & Not Done [] - Not yet Done

@fielding
fielding / Block.js
Last active December 28, 2018 21:19
primitive blockchain implementation in javascript
const sha256 = require("crypto-js/sha256");
function Block(data, parent) {
if ( parent) {
this.index = parent.index + 1;
this.parentHash = parent.hash;
} else {
this.index = 0;
this.parentHash = null;
}
function solve(data) {
// example returns sum of a line of integers seperated by a space
// return data.split(' ').reduce((acc, cur) => acc += Number(cur), 0);
return data;
}
process.stdin.resume();
process.stdin.setEncoding('ascii');
This file has been truncated, but you can view the full file.
[
{
"timestamp": 1556742627000,
"dataType": "activity-hack",
"dataSource": "git@sage:/Users/fielding/etc",
"uuid": "96656ebe-b6d6-531a-9c68-5c92a7ccf50b",
"refs": [
"HEAD",
"master",
"origin/master",