Skip to content

Instantly share code, notes, and snippets.

import React, { useEffect, useState } from 'react';
import Web3 from 'web3';
import { ethers } from 'ethers';
import { configureGSN, RelayProvider } from '@opengsn/gsn';
import CaptureTheFlagJsonInterface from './abis/CaptureTheFlag.json';
const RELAY_HUB_ADDRESS = '0xF17eEDa3701cf50a2Cb1ad5cbeA64F753725DC80';
const FORWARDER_ADDRESS = '0xEd89B8Af2338054fdB9Bab87b6AA431bF3954711';
const STAKE_MANAGER_ADDRESS = '0x789c213D6671D76b481f7A72B7C68e8d303303bF';
const CAPTURE_THE_FLAG_ADDRESS = '0xd1a25969B516e0C9ecfc90cd7108E3E2e402f971';
[
{ "code": "AF", "flag": "\ud83c\udde6\ud83c\uddeb", "name": "Afghanistan" },
{ "code": "AX", "flag": "\ud83c\udde6\ud83c\uddfd", "name": "Åland Islands" },
{ "code": "AL", "flag": "\ud83c\udde6\ud83c\uddf1", "name": "Albania" },
{ "code": "DZ", "flag": "\ud83c\udde9\ud83c\uddff", "name": "Algeria" },
{ "code": "AS", "flag": "\ud83c\udde6\ud83c\uddf8", "name": "American Samoa" },
{ "code": "AD", "flag": "\ud83c\udde6\ud83c\udde9", "name": "Andorra" },
{ "code": "AO", "flag": "\ud83c\udde6\ud83c\uddf4", "name": "Angola" },
{ "code": "AI", "flag": "\ud83c\udde6\ud83c\uddee", "name": "Anguilla" },
{ "code": "AQ", "flag": "\ud83c\udde6\ud83c\uddf6", "name": "Antarctica" },
@willrnch
willrnch / freshdesk.js
Created June 21, 2017 14:06
Get freshdesk stats
const request = require('request-promise'); // npm install request request-promise
const API_KEY = '******';
request('https://bloomon.freshdesk.com/agents.json', {
headers: {
'Content-Type': 'application/json'
},
auth: {
user: API_KEY,
@willrnch
willrnch / create_db.sh
Last active August 29, 2015 14:07
Create MySQL database with random user
#!/bin/bash
pass=`openssl rand -hex 12`
db=$1
if [ -z $1 ]; then
db=`openssl rand -hex 12`
fi
user=$db

Keybase proof

I hereby claim:

  • I am costent on github.
  • I am wr (https://keybase.io/wr) on keybase.
  • I have a public key whose fingerprint is 1F3A 98C9 B951 8322 9758 F604 8041 3B08 EBF3 14AF

To claim this, I am signing this object:

@willrnch
willrnch / ember.js
Created May 9, 2014 15:32
24dcb0c566284a7aa926e701d33f40717264b9b1
This file has been truncated, but you can view the full file.
/*!
* @overview Ember - JavaScript Application Framework
* @copyright Copyright 2011-2014 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
* @version 1.7.0-beta.1+canary.24dcb0c5
*/
#!/bin/sh
# Nginx light
yum install pcre-devel zlib-devel openssl-devel
# apt-get install libpcre3-dev libssl-dev
./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
@willrnch
willrnch / heroku_connect_https.js
Created April 30, 2013 15:43
Destect secure connection with connect.js on Heroku
/* detect HTTPS on Heroku */
app.use(function(req, res, next) {
req.https = (req.headers['x-forwarded-proto'] === 'https');
req.https = false;
next();
});
@willrnch
willrnch / Gruntfile.js
Created April 19, 2013 21:58
Yeoman Gruntfile Ember.js
// Generated on 2013-04-16 using generator-ember 0.2.4
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
@willrnch
willrnch / ember-data.js
Last active December 10, 2015 19:08
Last commit: 79fbf55 (2013-04-20 18:05:44 -0700) rev. 12
// Last commit: 79fbf55 (2013-04-20 18:05:44 -0700)
(function() {
var define, requireModule;
(function() {
var registry = {}, seen = {};
define = function(name, deps, callback) {