Skip to content

Instantly share code, notes, and snippets.

View FWDekker's full-sized avatar
🥔

Florine W. Dekker FWDekker

🥔
View GitHub Profile
@FWDekker
FWDekker / git-bundle.sh
Last active August 18, 2022 12:48
How to archive a git repository (because I always forget how it works)
#!/bin/bash
# See also: https://git-scm.com/docs/git-bundle
# Create archive
## Bundle the entire repository into a file named `repo.bundle`
git bundle create repo.bundle --all
@biiont
biiont / iterate_shell_array.sh
Last active February 7, 2023 18:00 — forked from anonymous/iterate_shell_array.sh
Iterate over an array using POSIX Shell
#!/bin/sh
# Iterate over an array using POSIX Shell
# Initial data
ARR="a:b:c:d"
# Iteration. Do whatever is needed instead of 'echo "$VAL"'.
CDR="${ARR}:"; while [ -n "$CDR" ]; do CAR=${CDR%%:*}; echo "$CAR"; CDR=${CDR#*:}; done; unset CAR CDR
# IMPORTANT!!! Add semicolon to the end of an array (IT="${ARR}:") to make stop condition working.
@chrisvest
chrisvest / CodeGenMeta.java
Created March 30, 2014 14:53
Example showing how to generate, compile, load and run Java programs at run-time.
import javax.tools.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
@cobyism
cobyism / gh-pages-deploy.md
Last active April 12, 2025 09:10
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).