Skip to content

Instantly share code, notes, and snippets.

View idkjs's full-sized avatar

Alain Armand idkjs

View GitHub Profile
@idkjs
idkjs / GitHub-Forking.md
Created May 31, 2020 18:06 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@idkjs
idkjs / sig
Created May 7, 2020 04:11 — forked from yawaramin/sig
Bourne Shell script to print out Merlin's inferred signature of an OCaml file (module)
#!/usr/bin/env sh
# Works with merlin version 2.5.4. Using protocol described at
# https://github.com/ocaml/merlin/blob/master/doc/dev/OLD-PROTOCOL.md#type-checking
usage ()
{
echo Usage: either of the following will work:
echo
echo ' sig module.ml'
@idkjs
idkjs / README.md
Created February 25, 2020 16:55
SQLite Points Bot

SQLite-based Points Bot

This is the example code for This Guide. Please read that guide to understand the code provided here.

On the other hand, if you know what you're doing, here's a quick how-to:

  • In an admin command prompt or powershell, run npm i -g --production windows-build-tools.
  • Close all open command prompts for your bot, or the following won't work.
  • npm i discord.js better-sqlite3
  • Create app.js and config.json per below.
  • Make sure to get your bot token in the config.json.
@idkjs
idkjs / reason-remote-data.re
Created September 7, 2019 14:13 — forked from busypeoples/reason-remote-data.re
ReasonML port remote-data
/*
remote-data ported to ReasonML
See also https://github.com/krisajenkins/remotedata
Tools for fetching data from remote sources (incl. HTTP).
*/
type remoteData 'e 'a
= NotAsked
| Loading
@idkjs
idkjs / refmt.sh
Created February 9, 2019 08:42 — forked from maht0rz/refmt.sh
cd tezos-environment-manager/src/contracts/
refmt --parse re --print ml multisig.re > multisig.liq
// originaly from https://kb.apify.com/tips-and-tricks/scraping-data-from-websites-using-schemaorg-microdata
function schemaOrgParser() {
var extractValue = function(elem) {
return $(elem).attr("content") || $(elem).text()
|| $(elem).attr("src") || $(elem).attr("href") || null;
};
var addProperty = function(item,propName,value) {
if( typeof(value)==='string' )
value = value.trim();
if( Array.isArray(item[propName]) )
open ReasonReact;
open Utils;
type state = {
shown : bool,
value : string
};
let file_dialog = ReasonReact.reducerComponent("InputDialog");
@idkjs
idkjs / glob-up-and-running.md
Created December 1, 2017 10:29 — forked from reggi/glob-up-and-running.md
A tutorial on how to get started using glob patterns in your terminal. #writing

Glob Up and Running

To test a glob pattern go over to globtester and play around with creating your own file structure online, it's super easy to get started that way.

If you want to test out a glob pattern in the terminal use echo followed by the pattern, for instance.

echo **/*.js
@idkjs
idkjs / README.md
Created November 20, 2017 14:10 — forked from busypeoples/README.md
Making Impossible States Impossible in ReasonML

Making Impossible States Impossible in ReasonML

Introduction

If you have already seen Richard Feldman's talk entitled "Making Impossible States Impossible" or have read "Designing with types: Making illegal states unrepresentable" then you can skip the explanations and just head straight to the Reason examples.

This post is intended to display how to model your Reason Application to prevent creating impossible states. The benefits of being able to design a feature in this way include avoiding having to deal with complex test scenarios regarding defined business rules and a clear documentation of what is possible just by looking at the type definition. Long story short, let's see how this all works by implementing an example.

Requirements

@idkjs
idkjs / app.js
Created November 15, 2017 12:47 — forked from dwwoelfel/app.js
OneGraph YouTube Demo
const VideoQuery = gql`
query videoPlayerQuery {
ytVideo(id: $videoId) {
id
statistics {
viewCount
likeCount
dislikeCount
}
snippet {