Skip to content

Instantly share code, notes, and snippets.

View mwilc0x's full-sized avatar
:shipit:

Mike Wilcox mwilc0x

:shipit:
View GitHub Profile
@mwilc0x
mwilc0x / docker-compose.yml
Last active June 20, 2022 22:57
IPFS Docker Config Setting Fatal Error - how do I reset it?
############
### ipfs ###
############
ipfs:
container_name: ipfs-node
image: ipfs/go-ipfs:latest
environment:
IPFS_PROFILE: ${IPFS_PROFILE}
IPFS_PATH: ${IPFS_PATH}
@mwilc0x
mwilc0x / [email protected]
Created January 8, 2022 18:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@mwilc0x
mwilc0x / gist:db02b4a0fe350cc024d8ba4ab78dddd8
Created May 23, 2020 13:13
create-react-app npm re-install console output
mike$ npm install
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
> [email protected] install /Users/mike/hack/testing/node_modules/jest-haste-map/node_modules/fsevents
> node install.js
@mwilc0x
mwilc0x / server.ts
Created May 16, 2020 15:59
simple deno app server
import { Application } from "https://deno.land/x/oak/mod.ts";
import { config } from "https://deno.land/x/dotenv/mod.ts";
const app = new Application();
const { HOST, PORT } = config();
console.log(`Listening on port:${PORT}...`);
await app.listen(`${HOST}:${PORT}`);
@mwilc0x
mwilc0x / yarn.txt
Last active January 23, 2017 23:02
yarn info
Yarn is a package manager that wraps around the existing node package manager (npm).
The main advantages yarn offers are around the install process of node modules and how those are cached in a yarn.lock file.
If you have worked with node_modules before, you might be familiar with npm-shrinkwrap.json. Essentially think of yarn.lock
as a replacement for npm-shrinkwrap.json.
We recommend choosing yarn.lock over npm-shrinkwrap.json in production because it gives more reliable and deterministic builds.
To get started with yarn, you'll need to download it: https://yarnpkg.com/en/docs/install
@mwilc0x
mwilc0x / gist:25e126f45a29ee58f313
Last active August 29, 2015 14:10
om ClojureScript ref-cursor error when trying to update vector using om/transact
(ns cljs-playground.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def app-state
(atom
{:comments-data [{ :author "Commenter 1" :text "comment 1" }
{ :author "Commenter 2" :text "comment 2" }]}))
var express = require("express"),
http = require("http"),
app = express(),
port = process.env.PORT || 3000,
socketio = require('socket.io'),
imdb = require('imdb-api');
app.use(express.static(__dirname + '/dist'));
var server = http.createServer(app);
@mwilc0x
mwilc0x / gist:7817585
Last active December 30, 2015 10:39
I successfully receive data in mapsRequest object, however when I go to
app.controller('MapCtrl', ['$scope', '$rootScope', function ($scope, $rootScope) {
$scope.lat = 40.722283;
$scope.lng = -74.005623;
$scope.mapOptions = {
center: new google.maps.LatLng($scope.lat, $scope.lng),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
// inject $rootScope into application when we bootstrap
// call below line of code when save is called after
// client has been switched (ie. we have called the re-assign dialog and user clicked continue)
$rootScope.$broadcast('clientChange');
app.controller('MainCtrl', function MainCtrl() {
$scope.MainClientSelected = {};
$scope.Client2Selected = {};
@mwilc0x
mwilc0x / gist:3366818
Created August 16, 2012 04:25
The peer connector class
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;
import java.util.logging.Logger;
/**