Skip to content

Instantly share code, notes, and snippets.


Dan Allen mojavelinux

View GitHub Profile
briandominick / asciidoc-static.adoc
Last active Aug 2, 2022
Static Site Generators with AsciiDoc Support
View asciidoc-static.adoc

There are 24 static site generators that support AsciiDoc sourcing.

View gist:829d0900f3314acffe462f2e552dd3f6
1-In the github repo on Settings > Integration & Services, enable
2-Go to travisCI page and enable the repo
3-Configure the env variables on TravisCI so that it is not necessary to save credentials on github
-in the project Settings on TravisCI, add the entry for netlify site id: NETLIFY_SITE_ID - <site_id from .netlify file generated on netlify create>
-create a netlify access token for TravisCI
-On Netlify Dashboard, Go to Account Settings > OAuth Applications ( > Personal access tokens and press New Access Token
-Name it anything, but to make it easier the suggestion is name TravisCI.
-Generate it and COPY it - you won’t see it again!
-in the project Settings on TravisCI, add the entry for netlify personal access token generated for TravisCI: NETLIFY_ACCESS_TOKEN
4-Generate a .travis.yml file in the local repo
j-po /
Last active Aug 7, 2022
`pushd` and `popd`-style commands for git branches (in the place of directories)
# `pushd` and `popd`-style commands for git branches (in the place of directories)
# USAGE: `pushb <branch>; SOME_WORK; popb`
GITSTACK=() # stack of branches–just an array that we add to and access from the tail
GITSTASHCK=() # stack of stashes
function pushb {
GITSTACK+=`git symbolic-ref --short HEAD`
GITSTASHCK+=`git stash create`
git reset --hard # `git stash create` doesn't do this the way `git stash` normally does
git checkout $1
paulirish /
Last active Aug 14, 2022
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
jordan-brough / git-recent
Last active Jul 26, 2022
Git: Display a list of recently checked out branches/tags/commits
View git-recent
#!/usr/bin/env bash
# Source:
# See also:
# Download this script as "git-recent" (no extension), chmod it to be executable and put it in your
# path somewhere (e.g. /usr/bin). You can then use it via `git recent` from inside any git repo.
# Examples:
ItGumby / build.gradle
Last active Oct 11, 2017 — forked from ysb33r/gist:0c534d165863628a07cc
gradle build file for presentations from asciidoctor and deck.js
View build.gradle
// You will need the VFS plugin
buildscript {
repositories {
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0'
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:0.5'
classpath 'commons-httpclient:commons-httpclient:3.1'
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

paulmillr /
Last active Aug 12, 2022
Most active GitHub users (by contributions).

Most active GitHub users (

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

 .filter(user =&gt; user.followers &gt; 1000)
View background_noise_function.rb
require "rubygems"
require "chunky_png"
require "base64"
module Sass::Script::Functions
def background_noise(c, noise = 0.5, opacity = 0.08, size = 200, mono = false)
# Convert SASS numbers to Ruby classes
noise = noise.to_s.to_f if noise.is_a? Sass::Script::Number
# Program locations
get_modules=$(svn list --xml | xmlstarlet sel -T -t -m "//name" -c . -n)