Skip to content

Instantly share code, notes, and snippets.

View idkjs's full-sized avatar

Alain Armand idkjs

View GitHub Profile
@idkjs
idkjs / dotfiles-install.fish
Created December 11, 2020 11:03
initialize dotfiles bare repository for fish dotfiles per https://www.atlassian.com/git/tutorials/dotfiles
#!/bin/fish
# clones my dotfiles. If you are using this, fork this and add the link to you own dotfiles
# https://www.atlassian.com/git/tutorials/dotfiles
git clone --bare idkjs/dotfiles.git "$HOME/.dotfiles"
function dotfiles
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$argv"
end
mkdir -p .dotfiles-backup
# dotfiles checkout
if [ (dotfiles checkout) = 0 ]
@idkjs
idkjs / dotfiles-init.fish
Last active December 11, 2020 11:04
initialize dotfiles bare repository for fish dotfiles per https://www.atlassian.com/git/tutorials/dotfiles
#!/bin/fish
# https://www.atlassian.com/git/tutorials/dotfiles
# initialize bare repository
git init --bare "$HOME/.dotfiles"
# create a local alias for dotfiles so we can run it here in init script
alias dotfiles '/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
# run our dotfiles alias to configure git to not show untracked files
dotfiles config --local status.showUntrackedFiles no
# echo "function dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> "$HOME/.config/fish/conf.d/dotfiles.fish"
@idkjs
idkjs / SomeApp.re
Created September 16, 2020 14:48 — forked from johnhaley81/SomeApp.re
open Relude.Globals; // I usually do this in bsconfig
type user = {
firstName: string,
lastName: string,
};
type error =
| AlreadyLoggedIn;
type context = {
@idkjs
idkjs / fish_motoko.sh
Created September 6, 2020 16:32
fish shell motoko install
#!/usr/bin/env sh
sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
@idkjs
idkjs / introspectionQuery.graphql
Created September 3, 2020 19:28
instrospectionQuery which can be used in Postman.app
query IntrospectionQuery {
__schema {
queryType {
name
}
mutationType {
name
}
subscriptionType {
name
// https://twitter.com/reasonml/status/1238026671581622272?s=20
// https://gist.github.com/chenglou/b6cf738a5d7adbde2ee008eb93117b49
// This is a proper alternative to
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14
// The one in that file uses Promise, but that's *wrong*.
// We only used promise as a demo of its API. We'll remove it soon.
// As you can see below, the pure XMLHttpRequest code is just as clean,
// less mysterious for all, more performant, extensible, and actually correct.
// https://twitter.com/reasonml/status/1238026671581622272?s=20
// https://gist.github.com/chenglou/b6cf738a5d7adbde2ee008eb93117b49
// This is a proper alternative to
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14
// The one in that file uses Promise, but that's *wrong*.
// We only used promise as a demo of its API. We'll remove it soon.
// As you can see below, the pure XMLHttpRequest code is just as clean,
// less mysterious for all, more performant, extensible, and actually correct.
@idkjs
idkjs / colors.re
Last active July 23, 2020 20:59
using variants to get access to two different types in ReasonML
module Colors = {
type sectionColors = {
primary: string,
header: string,
};
type mainColors = {
primary: string,
header: string,
};

get-graphql-schema npm version

Fetch and print the GraphQL schema from a GraphQL HTTP endpoint. (Can be used for Relay Modern.)

Note: Consider using graphql-cli instead for improved workflows.

Install

@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