Skip to content

Instantly share code, notes, and snippets.

View dmihal's full-sized avatar

David Mihal dmihal

View GitHub Profile
@dmihal
dmihal / fb-download-photos.js
Created June 1, 2016 18:15
Download all visible photos from a Facebook Page
// Run in console
var imgs = Array.from(document.querySelectorAll('._53s'))
var ids = imgs.map(img => img.dataset.fbid)
var time = 0;
ids.forEach(function(id){
setTimeout(function(){
console.log(id)
document.location.assign('https://www.facebook.com/photo/download/?fbid=' + id);
}, time);
time += 3000;
#!/usr/bin/python
""" Convert sketch files to open with older versions of Sketch.
Based on https://sketchtalk.io/discussion/2546/file-backwards-compatibility
"""
__author__ = "David Mihal"
__license__ = "GPL"
import zipfile
import sys
import json
@dmihal
dmihal / deploy.js
Created November 10, 2017 20:50
Zip and upload files from the `build` directory to the Chrome Webstore
require('shelljs/global');
require('dotenv').config();
const fs = require('fs');
const archiver = require('archiver');
const webstore = require('chrome-webstore-upload');
const fetch = require('isomorphic-fetch');
function createZip(path) {
return new Promise((resolve, reject) => {
var output = fs.createWriteStream(path);
@dmihal
dmihal / BasicToken.sol
Created February 27, 2018 23:26
Basic ERC20 TOken
pragma solidity ^0.4.18;
import "../../math/SafeMath.sol";
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken {
using SafeMath for uint256;
@dmihal
dmihal / basic-burner-wallet.jsx
Last active January 7, 2020 14:27
Basic Burner Wallet
import React from 'react';
import ReactDOM from 'react-dom';
import { xdai, dai, eth } from '@burner-wallet/assets';
import BurnerCore from '@burner-wallet/core';
import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers';
import { InfuraGateway, InjectedGateway, XDaiGateway } from '@burner-wallet/core/gateways';
import Exchange, { Uniswap, XDaiBridge } from '@burner-wallet/exchange';
import ModernUI from '@burner-wallet/modern-ui';
const core = new BurnerCore({
import { xdai, dai, sai, eth, keth, kdai } from '@burner-wallet/assets';
//...
const core = new BurnerCore({
assets: [xdai, dai, sai, eth, keth, kdai],
// ...
});
//...
import { xdai, dai, eth, ERC777Asset, ERC20Asset, NativeAsset } from '@burner-wallet/assets';
// ...
const goerlieth = new NativeAsset({
id: 'geth',
name: 'gETH',
network: '4',
});
const buffidai = new ERC777Asset({
import ENSPlugin from '@burner-wallet/ens-plugin';
import ERC681Plugin from '@burner-wallet/erc681-plugin';
import RecentAccountsPlugin from '@burner-wallet/recent-accounts-plugin';
import MetamaskPlugin from '@burner-wallet/metamask-plugin';
//...
const BurnerWallet = () =>
<ModernUI
title="Basic Wallet"
import { xdai, dai, eth, ERC20Asset } from '@burner-wallet/assets';
import Exchange, { Uniswap, XDaiBridge } from '@burner-wallet/exchange';
//...
const mkr = new ERC20Asset({
id: 'mkr',
name: 'Maker',
address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
network: '100',
priceSymbol: 'MKR',
import { xdai, dai, eth, ERC20Asset } from '@burner-wallet/assets';
import Exchange, { Uniswap, XDaiBridge } from '@burner-wallet/exchange';
//...
const mkr = new ERC20Asset({
id: 'mkr',
name: 'Maker',
address: '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
network: '100',
priceSymbol: 'MKR',