Skip to content

Instantly share code, notes, and snippets.

View JoeyBurzynski's full-sized avatar
💭
Hacking away on @EdgeSEO tools.

Joey Burzynski JoeyBurzynski

💭
Hacking away on @EdgeSEO tools.
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / Asset.txt
Created August 12, 2015 12:22
Install Ruby 2.2.2 On Ubuntu
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
@JoeyBurzynski
JoeyBurzynski / 00.howto_install_phantomjs.md
Last active August 29, 2015 14:27 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev

If you import live data into Google Docs spreadsheets using the importdata function and you want to force a refresh at a certain interval, but you also want to ensure that some cache-busting goes on, append a querystring that's the epoch time value that the refresh occurs, so for a sheet that should grab new data every hour you could force an update like this:

importData("http://example.com/data.csv?" & hour(googleclock()) & ")")

But the url requested looks like this: http://example.com/data.csv?11 if the refresh happened at 11am. The next day at 11, the url will be the same, so there's a chance you may get cached data. To get around this, use an epoch time-based refresh. The formula:

=((date(year(googleclock()),month(googleclock()),day(googleclock())) & " " & time(hour(googleclock()), 0, 0)) - DATE( 1970;1;1))*86400

gives you the epoch timestamp for the time at the current hour. If you wanted the timest

@JoeyBurzynski
JoeyBurzynski / meetup.go
Created December 4, 2015 20:46 — forked from temoto/meetup.go
Meetup is a micro proxy program that enables to connect two endpoints via TCP sockets. Either of endpoint may listen or connect. Example usage: - you have a faulty PHP application and you want to debug it with xdebug - xdebug can connect to your machine:9000, but you are behind NAT - so you run `meetup -listen1=:9000 -listen2=:9001` on the appli…
// Meetup is a micro proxy program that enables to connect two endpoints via TCP sockets.
// Either of endpoint may listen or connect.
//
// Example usage:
// - you have a faulty PHP application and you want to debug it with xdebug
// - xdebug can connect to your machine:9000, but you are behind NAT
// - so you run `meetup -listen1=:9000 -listen2=:9001` on the application server
// - and another `meetup -connect1=appserver:9001 -connect=localhost:9000` on your machine
// First instance listens two ports and when a connection arrives on both, it creates
// a bidirectional buffered pipe between the two. The other instance connects to
@JoeyBurzynski
JoeyBurzynski / hash_inverse.rb
Created December 16, 2015 22:29 — forked from NigelThorne/hash_inverse.rb
ruby hash invert
require './hash_inverse'
describe Hash do
describe "when empty and asked for the inverse" do
it "returns an empty hash" do
{}.inverse.must_equal Hash.new
end
end
describe "when mapping are unique and asked for the inverse" do
@JoeyBurzynski
JoeyBurzynski / meta-tags.md
Created February 4, 2016 18:53 — forked from iamnewton/meta-tags.md
A collection of meta tags supported by most browsers, including the custom ones for various browsers.

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@JoeyBurzynski
JoeyBurzynski / LICENSE
Created February 23, 2016 13:32 — forked from sinisterchipmunk/LICENSE
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@JoeyBurzynski
JoeyBurzynski / watch.sh
Created March 3, 2016 23:52 — forked from rafaelrinaldi/watch.sh
Using bash and Dropbox to solve a problem with Git merge.

Using bash and Dropbox to solve a problem with Git merge.

The problem

In a small project I'm currently developing, we have this assets.fla file which was previously hosted under our Git repository. Due to bizarre problems with Git's merge tool and .fla file type (we were losing library symbols, for some reason), we decided to move assets.fla from our Git repository to the project's folder on Dropbox.
That was a smart move, problems with merge were gone and others could know everytime a update is made. But with the time (one day of working, lol) it was getting kind of annoying. Everytime I wanted to update some asset (generate the .swc file), I needed to edit the export path. There are three of us working on this file, and everybody needed to repeat the same thing every time a change was needed.

bash FTW

So, since I have a problem, where can be the solution? bash for sure!
Then I wrote a script to automatize this process and it now fits quite well on the project workflow.

//To fetch a branch, you simply need to:
git fetch origin
//This will fetch all of the remote branches for you. With the remote branches
//in hand, you now need to check out the branch you are interested in, giving
//you a local working copy:
git checkout -b test origin/test
@JoeyBurzynski
JoeyBurzynski / bash-cheatsheet.sh
Created April 12, 2016 12:01 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04