Skip to content

Instantly share code, notes, and snippets.

View tylergaw's full-sized avatar

Tyler Gaw tylergaw

View GitHub Profile
@tylergaw
tylergaw / gist:5bb03e347371e733ac2e
Created September 24, 2014 02:48
I can't sourcemap

I'm trying to enable source maps for Sass on my site http://tylergaw.com.

If you go there and look at:

developer tools > sources > tylergaw.com > css > scss

you'll see modules and partials. Both of those directories have all the file names for the source files. If you click on any of them nothing will load. And if you hop over to the console you'll see that they a 404. That's because they do not exist on the server. That's my issue.

I'm using Jekyll to generate my site. When jekyll builds it copies the scss dir from src to public (my jekyll destination dir), but strips out all subdirectories. In this case modules and partials. For some reason it leaves the .scss file in there.

@tylergaw
tylergaw / gist:daf512585659228d2bd0
Created August 9, 2014 18:52
Common places to make PATH additions
# A list of potential files where users or scripts/apps/whatevs might add to the PATH
~/.bash_profile
~/.bashrc
~/.profile
~/.bash_custom
@tylergaw
tylergaw / running the script
Last active August 29, 2015 14:05
Passing quoted string of directory name as an argument
I'm calling the shlelfish.sh script below from Objective-C's NSTask. It has an arguments property. That property is an Array. I need to include
the name of a directory in that array and it needs to be a string; single or double-quoted. When the string of the directory
name is passed to the script it seems like it's equivilent to the following:
./shelfish.sh "~"
ls: ~: No such file or directory
Each time I try with either ls or cd or the command I actually need to run which requires a directory it fails with the same error.
@tylergaw
tylergaw / gist:551412a0e5150418b036
Last active August 29, 2015 14:02
Yosemite Tweaks

Yosemite Upgrade Tweaks

I switched to OS X 10.10 Yosemite a couple weeks after the Beta release. While it's been surprising stable, there are a few things I've had to tweak for development. Compiling a list here.

Homebrew was dead [fixed]

I followed this: http://jcvangent.com/fixing-homebrew-os-x-10-10-yosemite

Ruby/RVM/Ruby Gems was fishy [fixed..enough]

I think this has something to do with the system update to Ruby 2.0.

@tylergaw
tylergaw / Generate Stylesheet.sketchplugin
Created June 8, 2014 22:03
Generate a CSS ruleset for every layer of the current page of a Sketch document
var allLayers = sketch.doc.currentPage().layers();
function createRuleSetStr (layer) {
var str = '';
var selector = '.' + layer.name().toLowerCase().replace(/ /gi, '-');
var attrs = layer.CSSAttributes();
str += selector + ' {';
for (var i = 0; i < attrs.count(); i += 1) {
@tylergaw
tylergaw / Rating-Control.markdown
Created May 10, 2014 18:19
A Pen by Tyler Gaw.

Rating Control

I built a version of this for a site. Pretty sure I've made these in the past, but this version felt really resolve. Using the fonticons for the active/inactive states and the mixin for displaying the users' rating feel like a clean solution.

A Pen by Tyler Gaw on CodePen.

License.

@tylergaw
tylergaw / Sass-if-function.markdown
Created April 17, 2014 16:47
A Pen by Tyler Gaw.

Sass if function

Semi trivial example showing how the built-in Sass if function can be used like a ternary operator.

A Pen by Tyler Gaw on CodePen.

License.

@tylergaw
tylergaw / gist:9352620
Created March 4, 2014 18:31
I am not smart/don't understand scope I guess
# I'm on Ruby 1.9.2
# Using sinatra 1.4.4
require "sinatra"
module TestModule
get "/" do
"Hello world"
end
end
@tylergaw
tylergaw / gist:8694184
Created January 29, 2014 18:41
Updated Pocket RSS loop to display dates
foreach ($sxml->channel->item as $item) {
$formattedDate = date('F d, Y', strtotime($item->pubDate)); // January 02, 2014
// For more format strings check out http://us2.php.net/manual/en/function.date.php
echo "<li class='tweet-item'>";
echo "<h8>" . $item->title . "</h8>";
echo "<br><a href=". $item->link ." target='_blank'>" . $item->link . "</a><br>";
echo $formattedDate;
echo "</li>";
}
@tylergaw
tylergaw / dabblet.css
Created January 5, 2014 18:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
h1 {
font-family: 'Josefin Slab', serif;
}