Skip to content

Instantly share code, notes, and snippets.

View smockle's full-sized avatar

Clay Miller smockle

View GitHub Profile
@smockle
smockle / hide_dates.vb
Created March 3, 2014 05:47
Hides rows containing past dates.
Sub Hide_Dates()
Dim MyRange As Range, c As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set MyRange = Range("A1:A4436")
MyRange.EntireRow.Hidden = False
For Each c In MyRange
If IsDate(c.Value) And c.Value < Date Then
c.EntireRow.Hidden = True
End If
@smockle
smockle / biggio-angular.js
Created March 7, 2014 02:16
AngularJS directives and a controller. Used in a calendar/scheduling app.
/*jshint bitwise: true, curly: true, eqeqeq: true, forin: true, immed: true, indent: 4, latedef: true, newcap: true, noarg: true, noempty: true, nonew: true, quotmark: double, undef: true, strict: true, trailing: true, maxdepth: 4, esnext: true, browser: true, devel: true */
/*global $: true, angular: true, moment: true, $http */
var NG_BIG = angular.module("NG_BIG", []);
NG_BIG.directive("dateformat", function ($parse, $filter) {
return {
require: "ngModel",
link: function (scope, element, attrs, ngModel) {
// Input: What the model has in it.
@smockle
smockle / VirtualPath.cs
Created March 7, 2014 02:22
Allows multiple MVC sites to share the same Master Page, fetched from the server at compile time, instead of having to include it in each project.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Web.Caching;
using System.Web.Hosting;
namespace CWSToolkit {
public enum CWSMasterPages { Default, OIT, Test, Bootstrap };
@smockle
smockle / facebook.css
Created March 21, 2014 01:48
User styles that hide site functionality I don't use. Created with http://sobolev.us/stylish/.
#pagelet_trending_tags_and_topics,
#listsNav,
#appsNav,
#groupsNav,
#interestsNav,
#pagesNav,
#developerNav,
#timeline_info_review_unit,
#pagelet_pymk_timeline,
.recentActivityContainer,
@smockle
smockle / android-studio.sh
Created April 2, 2014 13:28
How to sign Android Studio, so that you don't get any more "allow incoming network connections?" popups.
codesign -vvv /Applications/Android\ Studio.app
codesign -f -s "My Certificate" /Applications/Android\ Studio.app
@smockle
smockle / keybase.md
Created April 12, 2014 06:26
Keybase proof

Keybase proof

I hereby claim:

  • I am smockle on github.
  • I am smockle (https://keybase.io/smockle) on keybase.
  • I have a public key whose fingerprint is D74B D204 F68E 5E7D 9318 A636 6651 03DC 6EB4 C794

To claim this, I am signing this object:

@smockle
smockle / A Very Old Man With Enormous Wings.md
Last active August 29, 2015 14:00
"A Very Old Man With Enormous Wings" by Gabriel García Márquez.

On the third day of rain they had killed so many crabs inside the house that Pelayo had to cross his drenched courtyard and throw them into the sea, because the newborn child had a temperature all night and they thought it was due to the stench. The world had been sad since Tuesday. Sea and sky were a single ash-gray thing and the sands of the beach, which on March nights glimmered like powdered light, had become a stew of mud and rotten shellfish. The light was so weak at noon that when Pelayo was coming back to the house after throwing away the crabs, it was hard for him to see what it was that was moving and groaning in the rear of the courtyard. He had to go very close to see that it was an old man, a very old man, lying face down in the mud, who, in spite of his tremendous efforts, couldn't get up, impeded by his enormous wings.

Frightened by that nightmare, Pelayo ran to get Elisenda, his wife, who was putting compresses on the sick child, and he took her to the rear of the courtyard. They both

@smockle
smockle / grips.md
Last active August 29, 2015 14:01
The idea behind Grips is that HTML templating and CSS preprocessing can be pretty much the same. Very neat.

Here are some thoughts I had after reading through the slides and gist:

  1. I don't think I'd often use *prop. I don't keep track of which properties/values need vendor prefixes (or nonstandard code) to work with the browsers I'm targeting. I use Autoprefixer, which uses data from the Can I Use? database.
  2. A command that generates JSON with keys representing the variable names used in a .gcss file would be handy.
  3. I feel like I missed the point of storing style variables in JSON. One benefit is "different site themes"--but most of my projects include a "_variables.scss" file that could be swapped out--oh, but that would require recompiling scss. I see. I think I get it now. Never mind!
@smockle
smockle / brackets.sh
Created June 20, 2014 21:20
Open files in Brackets via the command line. Usage: `brackets foo.txt` or `brackets ~/foo.txt` or `brackets ./foo.txt`
brackets() {
ifile=''
if [[ $1 == */c/* ]]
then
ifile+=$1
else
ifile+=`echo -n $(pwd)`
ifile+=/$1
fi
echo "$ifile"
@smockle
smockle / MIT-Creative.txt
Created July 3, 2014 07:50
An adaptation of the MIT license, intended for use with creative works.
MIT-Based License For Creative Works
Copyright (c) 2014 Clay Miller
Permission is hereby granted, free of charge, to any person obtaining
a copy of these creative works (the "Works"), to deal in the Works
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Works, and to permit persons to whom the Works are
furnished to do so, subject to the following conditions: