Skip to content

Instantly share code, notes, and snippets.

View blackfry's full-sized avatar
🤷‍♂️

Mark Dickie blackfry

🤷‍♂️
  • Cayman Pty Ltd
  • Sydney Australia
View GitHub Profile
// would like to remove the last object with duplicate value 'bob'
let objects = [{author: 'bob'}, {author: 'shazza'}, {author: 'softy mc dad bod'}, {author: 'cap'}, {author: 'bob'} ]
class FavouriteIcon extends Component {
constructor(props) {
super(props);
FavouriteIcon.defaultProps = {
style: {
position: 'relative',
top: 1,
color: 'grey',
fontSize: '26px'
}
@blackfry
blackfry / server.js
Last active May 22, 2017 08:31
server rendered with react router
import React from 'react';
import {renderToString} from 'react-dom/server';
import {StaticRouter} from 'react-router-dom';
import {createStore} from 'redux';
import {Provider}
import 'react-redux';
import reducer from 'reducer.js';
import App from 'App.js';
@blackfry
blackfry / bulletproof-git-workflow.md
Created May 23, 2017 01:48 — forked from db/bulletproof-git-workflow.md
bulletproof git workflow

Bulletproof Git Workflow

start working

git checkout master
git pull
git checkout -b feature/my-work
# edit your files

Keybase proof

I hereby claim:

  • I am blackfry on github.
  • I am blackfry (https://keybase.io/blackfry) on keybase.
  • I have a public key ASAMTlHS0KiWfsYXPWCGo8RQsnbH90EPOmOqtD-TaX6mvQo

To claim this, I am signing this object:

@blackfry
blackfry / filterFn.js
Last active February 26, 2019 05:12
JS filter elements
/**
https://www.hackerrank.com/challenges/filter-elements/problem
------
Given a list of N integers A = [a1, a2, ..., aN], you have to
find those integers which are repeated at least K times.
In case no such element exists you have to print -1.
If there are multiple elements in A which are repeated at least K times,
then print these elements ordered by their first occurrence in the list.
*/
@blackfry
blackfry / settings.json
Created April 14, 2019 21:48
vscode settings for jest runner
{
"python.pythonPath": "/Users/markdickie/.pyenv/versions/data-service/bin/python",
"jest.showCoverageOnLoad": true,
"files.exclude": {
"out": true,
"node_modules/jest-editor-support/src": false,
"coverage/": true
},
"search.exclude": {
"out": true,
@blackfry
blackfry / launch.json
Created April 14, 2019 21:49
vscode launch json for jest runner
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
@blackfry
blackfry / jest.config.js
Created April 14, 2019 21:51
jest config file
module.exports = {
verbose: true,
collectCoverage: true,
collectCoverageFrom: ['**/*.{js,jsx}', '!**/node_modules/**']
};
@blackfry
blackfry / keybindings.json
Created March 10, 2020 23:17
console.log shortcut vs code
[
{
"key": "shift+z",
"command": "type",
"args": {
"text": "console.log()"
},
"when": "editorTextFocus"
}
]