Skip to content

Instantly share code, notes, and snippets.

View jswny's full-sized avatar
🥵
Programming language elitist

Joe Sweeney jswny

🥵
Programming language elitist
View GitHub Profile
// ==UserScript==
// @name Poker Now HUD
// @namespace http://j1.io/
// @version 0.1
// @description HUD for Poker Now
// @author You
// @match https://www.pokernow.club/games/*
// @icon https://cdn.pokernow.club/favicon-cd2bc2773f4f49ce85f0.png
// @grant none
// ==/UserScript==
@jswny
jswny / Address.sol
Last active December 4, 2020 06:51
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.7.5+commit.eb77ed08.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
@jswny
jswny / Address.sol
Last active November 20, 2020 04:42
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
@jswny
jswny / Stacks.md
Last active September 18, 2020 16:01

Using an External MongoDB Database in Meteor

Meteor is an amazing full-stack framework which integrates MongoDB into it's DDP model. However, Meteor is closely integrated between it's different components, which makes it hard to modify its stack sometimes. Today, I'm going to demonstrate a simple trick to allow you to use your Meteor app with an external Mongo database, making it easier to integrate your Meteor app with other apps and data processing functions. This tutorial will even work with Meteor's regular DDP model, allowing for the continuation of the usual hot-reload upon data changes.

Server-Side

First, we need to set up the database on the server side. If you are using Meteor 1.3, you should place this code inside the /server directory of your app. It will be automatically loaded into the server.

var database = new MongoInternals.RemoteCollectionDriver('mongodb://user:password@localhost:27017/myapp')

How to Troubleshoot Linux

The most important thing I've learned from years of using Linux is how to troubleshoot problems. I've compiled a list of the most useful tips for fixing almost any Linux problem. Please enjoy but use these at your own risk!

  1. chmod Everything Your first step should be to give everything in sight permission to execute. This will allow any shy processes their fair share of your server. Try it out: chmod -R 777
  2. Disable SELinux This sneaky "feature" of Linux really just exists to make your life harder. Therefore, let's just turn it off forever: setenforce 0

And there you have it, you've successfully solved 99% of Linux problems! Congratulations, Bobby Tables, you did it!

Programming Language Wishlist

  • Simple specification (the language itself is simple)
  • Macros
  • Lightweight threads OR async-await
  • Produces native binaries
  • Garbage collected
  • String type system
  • Relatively mature
  • Developed on GitHub or similarly out in the open and easy to contribute to
  • Minimal reference/dereferencing (pointers)
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active July 3, 2023 05:25
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

Keybase proof

I hereby claim:

  • I am jswny on github.
  • I am jswny (https://keybase.io/jswny) on keybase.
  • I have a public key whose fingerprint is 1284 E6C7 D565 D04D BB6C 0FFA 9E92 B3A4 650C 5228

To claim this, I am signing this object:

@jswny
jswny / hn-opinions.md
Last active July 20, 2016 19:44
A list of things that Hacker News likes and dislikes.

Likes

  • Haskell
  • Go
  • Rust
  • Visual Studio Code
  • Vim
  • PostgreSQL
  • Elixir
  • Phoenix