Skip to content

Instantly share code, notes, and snippets.

View jimmynotjim's full-sized avatar
☀️
Enjoying SoCal "Fall"

Jimmy Wilson jimmynotjim

☀️
Enjoying SoCal "Fall"
View GitHub Profile
@jimmynotjim
jimmynotjim / url_params.js
Last active August 29, 2015 13:56
JS URL Param Functions
var ArrayToURL = function(array) {
var pairs = [];
for (var key in array)
if (array.hasOwnProperty(key))
pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(array[key]));
return pairs.join('&');
};
var URLToArray = function(url) {
var request = {};
@jimmynotjim
jimmynotjim / state_array.php
Last active January 3, 2016 09:59
PHP Array of US States
<?php
$state_array = array(
array(
'state_name' => 'Alabama',
'state_abbr' => 'AL'
),
array(
'state_name' => 'Alaska',
'state_abbr' => 'AK'
@jimmynotjim
jimmynotjim / .gitconfig
Last active December 29, 2016 15:55
Base .gitconfig
[apply]
whitespace = fix
[color]
# Use colors in Git commands that are capable of colored output when outputting to the terminal
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
@jimmynotjim
jimmynotjim / _instructions.md
Last active April 19, 2024 05:26
Setup macOS 12 Monterey

Leaving this for historical reasons, but with the latest iteration I set up proper dotfiles. Check em out

Setup macOS with a Clean Install

After too many years of tinkering my machine is a bit all over. With Mojave High Sierra Montery I wanted to start fresh

1. Run Software Update

Make sure everything is up to date.

@jimmynotjim
jimmynotjim / gist:7553673
Created November 19, 2013 22:24
Example scrollNav Init
$('#main').scrollNav({
headings: 'h1',
insertTarget: '#nav_box'
});
@jimmynotjim
jimmynotjim / gist:7530603
Created November 18, 2013 16:17
Fixing a hung Vagrant Box
I've run into this issue a few times and I finally found a solution that didn't involve blowing the box away and starting over. Here's the issue I kept having.
Vagrant would hang forever while booting, even though VirtualBox said the machine was running. When I tried ctrl+C it would say it's shutting down but still continue to hang. If I manually shut it down in VirtualBox it would shut down fine, but on restart have the same issue. Finally I found this and it essentially worked https://github.com/mitchellh/vagrant/wiki/%60vagrant-up%60-hangs-at-%22Waiting-for-VM-to-boot.-This-can-take-a-few-minutes%22
I don't have VBoxManage, but I do have the VirtualBox gui, so here's what I did:
1. Shut down the machine in VirtualBox gui w/ "Power Off"
2. Open the machine's settings and turn off both Adapter 1 and Adapter 2 under the Network tab.
3. Start the machine from the gui
4. It'll hang looking for network connections and eventually open to a prompt, enter `vagrant/vagrant`
@jimmynotjim
jimmynotjim / _readme
Last active December 27, 2015 08:39
Social Deck Source
I'm working on these social "cards" for my personal site and decided it'd me a good learning lesson to create a plugin for them. This is still a work in progress, but you can see where I'm going with it. I want to move the network related settings and functions into their own extension and keep just the core intact. I think I need to move the default settings and whatever global function I need out to the methods object. Not sure if that's correct though.
This an even cruder version, but let's you visually see what I'm doing http://jsfiddle.net/jimmynotjim/2Kg3g/embedded/result/
var activity = [
{
"id": "1870118241",
"type": "WatchEvent",
"actor": {
"id": 1280430,
"login": "jimmynotjim",
"gravatar_id": "81947d57121e888c5d7f264e1fb5aba1",
"url": "https://api.github.com/users/jimmynotjim",
"avatar_url": "https://0.gravatar.com/avatar/81947d57121e888c5d7f264e1fb5aba1?d=https%3A%2F%2Fa248.e.akamai.net%2Fassets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png&r=x"
<div class="select">
<select name="select_element">
<optgroup label="Option Group 1">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</optgroup>
<optgroup label="Option Group 2">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
/* scss */
#nav {
li a {
color: maroon;
body.admin & { border-bottom: dotted 1px maroon; } // <-- Awesome-sauce right there
&:hover {
color: purple;
}