Skip to content

Instantly share code, notes, and snippets.

const ethGasStationApiUrl = `https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=`;
const req = new Request(ethGasStationApiUrl);
const res = await req.loadJSON();
if (config.runsInWidget) {
const widget = new ListWidget();
const textColor = Color.dynamic(Color.black(), Color.white());
const title = widget.addText("Gas Prices");
title.textColor = textColor;
import path from 'path'
import fs from 'fs'
function* getFilesRecursive(dir) {
const dirents = fs.readdirSync(dir, { withFileTypes: true });
for (const dirent of dirents) {
const res = path.resolve(dir, dirent.name);
if (dirent.isDirectory()) {
yield* getFiles(res);
} else {
import { useState, useMemo } from "react";
type UseToggleInterface = [
boolean,
{
/**
* Set state value to `true`
*/
on(): void;
/**

Instructions

Create a fork of this codesandbox and make all tests pass.

https://codesandbox.io/s/ts-code-test-gb912

  • You should edit src/index.tsx
  • Codesandbox has an automatic test runner which should tell you when your solution is working.
  • Firefox or Chrome are suggested, other browsers have been known to cause problems with the test runner in Codesandbox

If you have any questions, please send an email to adam.zmenak@d1g1t.com, and send the URL of your submission to this email when you are done.

The basic idea was the remove floats from the layout and switch to flexbox.

  1. There is a selector .page:not(.home) #content which holds the content for site; changed the style to
padding-bottom: 100px;
padding-right: 30px;
padding-left: 200px;
display: flex;
justify-content: center;

Sourcegraph Notes

General

  • maybe the option to automatically sync remote repos would be nice(or some VScode style alert that N amount of remote changes have not been synced)
    • every so often I collapse all the files in explorer and go down the list and click on "sync" to get the latest files
  • Strange thing in search pallet, if I type in the name (or partial name) of a repo first, I cannot search within it eg.
    • I want to open the Field file in the formik repo
    • Field is super generic so I type formikfield in the search, but get no results

Adding New Repos

@azmenak
azmenak / bash
Created February 11, 2016 09:37
PPTP + Shadowsocks
#!/bin/sh
# Setup Simple PPTP VPN server and Shadowsocks server
printhelp() {
echo "
Usage: sh setup.sh [OPTION]
If you are using custom password , Make sure its more than 8 characters. Otherwise it will generate random password for you.
If you trying set password only. It will generate Default user with Random password.
example: sudo bash setup.sh -u vpn -p mypass
'use strict';
var React = require('react');
var ReactScriptLoaderMixin = require('react-script-loader').ReactScriptLoaderMixin;
var ReactStripeCheckout = React.createClass({
mixins: [ReactScriptLoaderMixin],
getDefaultProps: function() {
@azmenak
azmenak / rps.py
Created February 20, 2015 18:03
RPS Sample
import random
player = raw_input('RPS!: ')
RPS = ("rock", "paper", "scissors")
computer = RPS[random.randint(0,2)]
R = RPS[0]
P = RPS[1]
S = RPS[2]
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;