Skip to content

Instantly share code, notes, and snippets.

View harrypujols's full-sized avatar
👷‍♂️
Working from home

Harry Pujols harrypujols

👷‍♂️
Working from home
View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYaUIehYJKwYBBAHaRw8BAQdATK67SReGrxb7mlowhtrhEKOacEA2pDEFqDjB
98lSUsm0IUhhcnJ5IFB1am9scyA8aGFycnlwdWpvbHNAbWUuY29tPoiUBBMWCgA8
FiEE/pRt5wUG57ZhQLjF43CPT9GZ1aAFAmGlCHoCGwMFCwkIBwIDIgIBBhUKCQgL
AgQWAgMBAh4HAheAAAoJEONwj0/RmdWgtyoA/REjqxsP2hczAZ7Tjof5tDWCoMRF
CR7xcT38/twzDZ6HAQCH5vDc7kjOem4867V4/XjH+iPtLnNVTNrbz90N7qgQC7g4
BGGlCHoSCisGAQQBl1UBBQEBB0CQJpAn1eJHXLZDysGxRWM8D2B4tOR3E7dHs+lf
WfZ8dgMBCAeIeAQYFgoAIBYhBP6UbecFBue2YUC4xeNwj0/RmdWgBQJhpQh6AhsM
AAoJEONwj0/RmdWgLVgBAMYpS6UhDnpD5AbDKdxl0z0/9G2OC8FIrMMXMiJahDbb
# -*- mode: ruby -*-
# vi: set ft=ruby :
# IEUser, Passw0rd!
# run a windows virtual machine for cross-browser testing
Vagrant.configure("2") do |config|
config.vm.box = "Microsoft/EdgeOnWindows10"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "1024"
@harrypujols
harrypujols / execute.js
Created May 9, 2017 19:48
Execute shell command in javascript
#!/usr/bin/env node
function execute(command) {
const exec = require('child_process').exec
exec(command, (err, stdout, stderr) => {
process.stdout.write(stdout)
})
}
### Keybase proof
I hereby claim:
* I am harrypujols on github.
* I am harrypujols (https://keybase.io/harrypujols) on keybase.
* I have a public key ASCrZAUsbO3kSutYvm-0wNK_SXSTnljoniO2gWfM5hTtjQo
To claim this, I am signing this object:
@harrypujols
harrypujols / alarm.scpt
Created June 21, 2016 18:02
My Mac Alarm Script
tell application "iTunes"
play (track 1 of library playlist 1 whose album is "Look at Us")
-- I Got You Babe
set sound volume to 100
delay (get the (duration of the current track) - player position)
pause
end tell
@harrypujols
harrypujols / .vimrc
Created May 25, 2016 15:38 — forked from gosukiwi/.vimrc
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@harrypujols
harrypujols / dbimport.rb
Last active May 10, 2016 14:25
A little Ruby geanie script to import a sql file to the MAMP sql instance
puts "Hello, which database you want the file in?"
database = gets.chomp
puts "Where's the file you want to put in the database?"
filepath = gets.chomp
puts "Executing below line, please wait..."
puts ""
puts "/applications/MAMP/library/bin/mysql -u root -p #{database} < #{filepath}"
puts ""
@harrypujols
harrypujols / vue-include.js
Last active November 6, 2015 19:47
Simple include directive when using vue.js
Vue.directive('include', function () {
var url = this.expression
var _this = this
var request = new XMLHttpRequest()
request.open('GET', url, true)
request.onreadystatechange = function() {
if (this.readyState !== 4) return
if (this.status !== 200) return
_this.el.innerHTML = this.responseText
}

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).

// calling the sprites -- needs compass to run
// make sure the first part of the call matches the name of the folder
// inside the img folder where the separate sprite images will be located
$foo-layout: smart; // this is called as <folder>-layout - same goes with the following lines
$foo-spacing: 10px; // this doesn't seen to work when the layout is set as smart, but doesn't hurt to have it here
$foo-sprite-dimensions: true; // this will automatically add the dimensions of every image in the sprite
@import "foo/*.png"; // calls all the pngs in the folder called 'image' inside the img folder
@include all-foo-sprites; // it will add all the images in the sprite as classes in the compiled css
[class*="foo-"] {
display: inline-block;