Skip to content

Instantly share code, notes, and snippets.

@wesley6j
wesley6j / install-live.sh
Created December 17, 2021 14:45 — forked from KsaRedFx/install-live.sh
Install Ubuntu with debootstrap and chroot, without rebooting the host machine or using a iso
#!/bin/bash
echo "--------------------------------------------------------------------------------------"
echo "This script builds a full operating system with debootstrap and chroot"
echo "To use this script, please mount an empty partition or alternate disk"
echo ""
echo "If you are using btrfs, and using subvolumes, mount the root subvolume explicity"
echo "Example: mount /dev/sdb1 /media/bootstrap -o subvol=@"
echo "Failure to do this will cause the script to break. It needs the root directory"
echo ""
echo "The script is specifically built for Ubuntu"
@wesley6j
wesley6j / ansible-summary.md
Created September 15, 2019 15:30 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mixin flag-variant($height, $bg) {
display: block;
background:$bg;
position: relative;
line-height: $height;
font-size: $height*.5;
&::before,
&::after {
content: "";
#!/bin/bash
# linode stackscript to setup a user with my ssh key
# so that I can run ansible provisions
set -e
set -u
adduser --disabled-password --gecos "" my_user
@wesley6j
wesley6j / Gemfile
Created January 4, 2018 12:24 — forked from pboling/Gemfile
My latest project's Gemfile, implements bundle group pattern
source 'https://rubygems.org'
# Follows the bundler group pattern described here:
# http://iain.nl/getting-the-most-out-of-bundler-groups
# Gemfile.mine in root dir allows locally custom gems.
# NOTE: Doing this will change the Gemfile.lock - commit with care.
eval File.read(File.join(File.dirname(__FILE__), 'Gemfile.mine')) if File.exists? File.join(File.dirname(__FILE__), 'Gemfile.mine')
ruby '1.9.3'
@wesley6j
wesley6j / google_analytics_turbolinks5.js
Created November 9, 2017 12:24 — forked from Startouf/ google_analytics_turbolinks5.js
Google Analytics for Turbolinks 5 (& Rails 5)
// Google Analytics code to work with Turbolniks 5
this.GoogleAnalytics = (function() {
function GoogleAnalytics() {}
GoogleAnalytics.load = function() {
var firstScript, ga;
window._gaq = [];
window._gaq.push(["_setAccount", GoogleAnalytics.analyticsId()]);
window._gaq.push(['_setAllowAnchor', true]);
@wesley6j
wesley6j / fullscreen3.js
Created August 16, 2017 19:21 — forked from simonewebdesign/fullscreen3.js
JavaScript Full Screen API (completely cross-browser!)
// quando clicco su enterfullscreen:
// vai in fullscreen
// all'entrata in fullscreen:
// mostra pulsante exitfullscreen
// nascondi header e footer
// quando clicco su exitfullscreen:
// esci da fullscreen
@wesley6j
wesley6j / pr.md
Created June 29, 2017 13:43 — forked from piscisaureus/pr.md
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 = git@github.com:joyent/node.git

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:

module Acts
module Cacheable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_cacheable(key, options = {})
extend Acts::Cacheable::SingletonMethods
find(:all, options).each{|instance| cached_objects[instance.send(key).to_s] = instance}
@wesley6j
wesley6j / sass-hexagon.scss
Created February 14, 2016 15:58 — forked from bjmiller121/sass-hexagon.scss
SASS Mixin to generate a hexagon in CSS
// Makes a CSS hexagon! based off of http://csshexagon.com/
// Demo: http://sassmeister.com/gist/98fcf3ce163a97d2ef7e
@mixin hexagon($size, $color, $border: 0) {
position: relative;
width: $size;
height: ($size * 0.577);
background-color: $color;
margin: ($size * 0.288) 0;
border-left: $border;
border-right: $border;