Skip to content

Instantly share code, notes, and snippets.

View jorilallo's full-sized avatar

Jori Lallo jorilallo

View GitHub Profile
@jorilallo
jorilallo / determineRetinaUpload.js
Created December 19, 2018 22:15
Detect DPI information for a PNG image to determine if it's retina quality or not. This can be done by reading optional physical pixel dimensions chunk which both macOS and Windows attach to the image data.
import extract from "png-chunks-extract";
/**
* Detect if PNG image is in retina resolution.
*
* PNG Chunk documentation: https://www.w3.org/TR/PNG-Chunks.html
*/
const determineRetinaUpload = async (imageUrl) => {
let retinaImage = false;
const response = await fetch(imageUrl);
@jorilallo
jorilallo / Flex.js
Created August 17, 2017 20:06
Flexbox component for React
// @flow
import React from 'react';
import styled from 'styled-components';
type GlobalCssValues = 'initial' | 'inherit' | 'unset';
type WrapValue = 'nowrap' | 'wrap' | 'wrap-reverse' | GlobalCssValues;
type JustifyValue =
| 'center'
{
"extends": [
"@frontend/coinbase",
"prettier",
"prettier/react",
"prettier/flowtype"
],
"rules": {
"flowtype/type-id-match": [
2,
@jorilallo
jorilallo / .flowconfig
Created June 30, 2016 18:03
Flowtype config for Webpack and ES6/7
[ignore]
.*/node_modules/fbjs/.*
.*/node_modules/editions/.*
[include]
[libs]
[options]
# Support webpack's resolve.root

I absolutely HATE the new Kippt. It sucks. It's 1,000 times harder to view my links. It makes me more inefficient, which is the opposite of what I hoped Kippt could do for me. Also, moving the search feature to the left side of the screen is plain idiotic. Most sites have inadvertently trained users to look for this feature in the upper right corner of the screen, so that's what users do. But you guys place yours in the least-popular place to set a search feature, so that it literally is the last place one will look when seeking it. I left delicious because I liked your (now old) design, but the only thing I liked about Kippt is long gone. This new design may have inspired high-fives from all the geeks that created it, but for the common user, this is an absolute FAIL. It is not intuitive and it certainly does not simplify my workflow. If it does not change back by next week, my account will be inactive and I'll find another site to use. Last thing, fire all the morons that had a say in approving this shit sa

@jorilallo
jorilallo / gist:7b9b2e632964c5fbf827
Created January 29, 2015 21:17
Coinbase Exchange signing with PHP
<?php
class CoinbaseExchange {
public function __construct($key, $secret, $passphrase) {
$this->key = $key;
$this->secret = $secret;
$this->passphrase = $passphrase;
}
public function signature($request_url='', $body='', $timestamp=false, $method='GET') {
$body = is_array($body) ? json_encode($body) : $body;
@jorilallo
jorilallo / gist:c72e2211b7b8d3770bc3
Created January 29, 2015 21:17
Coinbase Exchange signing with Ruby
require "base64"
require 'openssl'
require 'json'
class CoinbaseExchange
def initialize(key, secret, passphrase)
@key = key
@secret = secret
@passphrase = passphrase
end
@jorilallo
jorilallo / gist:0cd603b691acb551b2e0
Created January 29, 2015 21:16
Coinbase Exchange signing with Python
# Requires python-requests. Install with pip:
#
# pip install requests
#
# or, with easy-install:
#
# easy_install requests
import json, hmac, hashlib, time, requests, base64
from requests.auth import AuthBase
@jorilallo
jorilallo / gist:1e61f3185ef75f00759b
Created January 29, 2015 21:15
Coinbase Exchange signing with Node.js
var crypto = require('crypto');
var secret = 'PYPd1Hv4J6/7x...';
var timestamp = Date.now() / 1000;
var req_url = '/orders';
var body = JSON.stringify({
price: '1.0',
size: '1.0',
Verifying that +jorilallo is my Bitcoin username. You can send me #bitcoin here: https://onename.io/jorilallo