Skip to content

Instantly share code, notes, and snippets.

View patricknelson's full-sized avatar
:shipit:
Pushing 1's and 0's.

Patrick Nelson patricknelson

:shipit:
Pushing 1's and 0's.
View GitHub Profile
@brendanmckeown
brendanmckeown / equal-grid-columns.scss
Last active August 29, 2015 14:19
Sass mixin for equal multi-column layout. Include in the parent selector and specify the number of columns, the size of the gap between columns, and the direct children selector. Depends on a clearfix solution for the parent, and assumes you have applied "box-sizing: border-box" at a global level. Example: http://jsfiddle.net/brendanmckeown/gzr8…
@mixin equal-grid-columns($columns, $gap, $el) {
@include clearfix;
> #{$el} {
float: left;
width: (100% / $columns);
$halfGap: ($gap / 2);
padding: 0 $halfGap;
margin-top: $gap;
@for $i from 1 through $columns {
@TrebuhD
TrebuhD / OverrideControllerTexture.cs
Last active September 12, 2018 21:48
Script to override SteamVR controller textures on load. Modified from »Mr_FJ« https://steamcommunity.com/app/358720/discussions/0/357287304420388604/
using UnityEngine;
using System.Collections;
/// <summary>
/// Override the texture of each of the parts with your texture.
/// </summary>
public class OverrideControllerTexture : MonoBehaviour
{
#region Public variables
[Header("Variables")]
@gsomoza
gsomoza / .bashrc
Created January 17, 2013 16:50
SSH Agent in Windows (Git Bash / MinGW)
#!bash.exe
export SSH_AUTH_SOCK=/tmp/.ssh-socket
echo ;
echo Starting connection with ssh-agent...
ssh-add -l 2>&1 >/dev/null
if [ $? = 2 ]; then
rm -f /tmp/.ssh-script /tmp/.ssh-agent-pid /tmp/.ssh-socket
# Exit status 2 means couldn't connect to ssh-agent; start one now
echo Creating new ssh-agent...
ssh-agent -a $SSH_AUTH_SOCK > /tmp/.ssh-script
@billiegoose
billiegoose / storageQuota.js
Created March 13, 2017 22:04
StorageQuota polyfill
// MIT License, Copyright William Hilton <wmhilton@gmail.com>
// Implement the proposed W3C Quota Management API (circa 2017)
navigator.storageQuota = {
get supportedTypes () {
let types = []
if (navigator.webkitTemporaryStorage) types.push('temporary')
if (navigator.webkitPersistentStorage) types.push('persistent')
return types
},
queryInfo (type) {
@scottsb
scottsb / resetting-csync2-cluster.md
Last active October 25, 2021 20:28
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

@cortvi
cortvi / !Refractive Surface Shader.md
Last active March 31, 2022 22:55
Custom refractive liquid surface shader
We couldn’t find that file to show.
@wolever
wolever / profile
Created September 11, 2013 15:41
My very fast Bash prompt, which shows git branch, virtualenv, and background jobs
# prompt examples:
# [3 jobs master virtualenv] ~/code/myproject/foo
# [1 job my-branch virtualenv] ~/code/bar/
# [virtualenv] ~/code/
# ~
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch)
if [[ "$USER" == "root" ]]
then
export PS1="\e[1;31m\]\u \[\e[1;33m\]\w\[\e[0m\] ";
@maxim
maxim / task.yml
Created June 12, 2014 11:09
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
@AdamManuel-dev
AdamManuel-dev / Svelte Custom Element v1 Wrapper
Last active April 28, 2023 21:35
This is a wrapper for turning a Svelte Component built as an entry point into a Web Component using the Custom Element v1 Spec
import Gallery from './COA/COAGallery.svelte';
/**
* C.O.A. Gallery Custom Element v1 Component Class
*/
class COAGallery extends HTMLElement {
/**
* This defines the attributes to watch in the custom element to trigger the `attributeChangedCallback` method
*/
static get observedAttributes() {
@liamfiddler
liamfiddler / style.11ty.js
Last active August 29, 2023 23:04
SCSS + PostCSS pipeline for 11ty
// sass dependencies: `npm i -D sass`
const util = require('util');
const sass = require('sass');
const renderSass = util.promisify(sass.render);
// postcss dependencies: `npm i -D autoprefixer postcss precss`
const autoprefixer = require('autoprefixer');
const postcss = require('postcss');
const precss = require('precss');
const postcssProcessor = postcss([precss, autoprefixer]);