Skip to content

Instantly share code, notes, and snippets.

@voger
voger / gh-pages-deploy.md
Created March 7, 2021 20:33 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@voger
voger / Git dot files management
Created April 24, 2018 19:54 — forked from lonetwin/Git dot files management
A simple way to manage dotfiles with git without silly symlinks and special tools. Just use negative matches in your .gitignore !
I like to manage dotfiles without having to mess with silly symlinks or having
to install/configure specific dotfile managament tools. So here's what I did:
$ cd ~
$ git init .
$ echo '*' > .gitignore # ignore all files by default
$ echo '!.bashrc' >> .gitignore # ...and then tell git what files not to *not* ignore
$ # ...add other files you may want to track to *not* ignore
$ git add .bashrc # now actually add the files to git
$ git add .gitignore # add the .gitignore to git
" Get the defaults that most users want.
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
filetype plugin indent on
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive' " Git support
Plug 'junegunn/vim-peekaboo' " Peek content of the registers
Plug 'junegunn/vim-easy-align' " A Vim alignment plugin
@voger
voger / .formatter.exs
Last active April 20, 2020 18:10
My custom .formatter.exs for elixir's mix format task
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"],
locals_without_parens: [
# Kernel
inspect: :*,
# Phoenix
plug: :*,
action_fallback: :*,
render: :*,
@voger
voger / config.ex
Created October 16, 2017 15:33 — forked from bitwalker/config.ex
Useful config wrapper for Elixir
defmodule Config do
@moduledoc """
This module handles fetching values from the config with some additional niceties
"""
@doc """
Fetches a value from the config, or from the environment if {:system, "VAR"}
is provided.
An optional default value can be provided if desired.
defmodule Qssite.Middleware.RequireAuthenticated do
@behaviour Absinthe.Middleware
@moduledoc """
Middleware to require authenticated user
"""
def call(resolution, config) do
case resolution.context do
%{current_user: _} ->
@voger
voger / STOSDisplay.js
Last active September 22, 2015 21:16
qx.Class.define('qssite.ui.window.STOSDisplay', {
extend: qssite.ui.window.SWindow,
construct: function(caption, icon) {
this.base(arguments, caption, icon);
this._initLayout()
},
events: {
"closedWithAccept": "qx.event.type.Event"