Skip to content

Instantly share code, notes, and snippets.

@XeroXP
XeroXP / gitignore_per_git_branch.md
Created April 10, 2023 14:16 — forked from wizioo/gitignore_per_git_branch.md
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

Menu "Hamburger" Icon Animations

Many folks use these, and their merits can be argued, but for practical purposes, the "Hamburger" icon has familiarity going for it, at the very least. These animations add a little more transparency to what it means from a UI perspective by transforming it into another recognizable icon - the closing "x". Full walkthrough here: http://designcouch.com/home/why/2014/06/23/playing-with-hamburger-icon-animations/

Forked from Jesse Couch's Pen Menu "Hamburger" Icon Animations.

A Pen by Rodrigo on CodePen.

License.

@XeroXP
XeroXP / dynamic_colspan.js
Created February 12, 2019 10:24 — forked from afbora/dynamic_colspan.js
Dynamic Colspan / Colspan All Columns on Bootstrap Sample
$(function() {
jQuery.fn.exists = function(){return this.length>0;}
// Dynamic Colspan
if($('[colspan="auto"]').exists())
{
$.each($('[colspan="auto"]'), function( index, value ) {
var table = $(this).closest('table'); // Get Table
var siblings = $(this).closest('tr').find('th:visible, td:visible').not('[colspan="auto"]').length; // Count colspan siblings
<?php
class Generator {
protected $namespaces = [];
protected $outputDirectoriesPSR4 = [];
protected $aliasMapTypes = [];
protected $inputFiles = [];
/*
* Methods to setup the data we need to generate
@XeroXP
XeroXP / Sample.java
Created February 23, 2018 07:02 — forked from albans/Sample.java
Java implementation of an algorithm for sampling without replacement by Donald Knuth
import static java.util.Arrays.asList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import com.google.common.collect.AbstractIterator;
public class Sample {