Skip to content

Instantly share code, notes, and snippets.

View BlakeWilliams's full-sized avatar
💭
building things, probably

Blake Williams BlakeWilliams

💭
building things, probably
View GitHub Profile
include $(GOROOT)/src/Make.inc
TARG=bot
GOFILES=*.go
include $(GOROOT)/src/Make.cmd
$("#nav li:not(.selected)").hover(
function () {
$('.selected').addClass("selectedHover");
},
function () {
$('.selected').removeClass("selectedHover");
}
);
@BlakeWilliams
BlakeWilliams / this thing
Created March 1, 2012 18:39 — forked from anonymous/this thing
this thing
<?php
session_start();
if (!isset($login)) {
header('Location: index.html');
}
?>
<body>
<iframe src="index.php"></iframe>
</body>
</html>
@BlakeWilliams
BlakeWilliams / swappable.js.coffee
Created May 8, 2012 03:19
Coffeescript replacement for Backbone.Router and Backbone.View to add a swappable router with managed children in views
# Add swap method to router
_.extend Backbone.Router.prototype,
swap: (newView) ->
@currentView.leave() if @currentView && @currentView.leave
@currentView = newView
$(@el).html @currentView.render().el
# set original Backbone.View reference
view = Backbone.View
module Haml::Filters::Markdown
include Haml::Filters::Base
lazy_require "redcarpet"
def md(text)
// redcarpet code
end
end
@BlakeWilliams
BlakeWilliams / gist:3166796
Created July 23, 2012 23:02
Scroll Style
var $win = $(window)
, $nav = $('.subnav')
, navTop = $('.subnav').length && $('.subnav').offset().top - 40
, isFixed = 0
processScroll()
// hack sad times - holdover until rewrite for 2.1
$nav.on('click', function () {
if (!isFixed) setTimeout(function () { $win.scrollTop($win.scrollTop() - 47) }, 10)
@BlakeWilliams
BlakeWilliams / gist:3321873
Created August 11, 2012 06:46
Messages.app spammer
tell application "Messages"
activate
repeat with myBuddy in buddies
if handler of myBuddy is "+18505555555" then
repeat
send "hey" to myBuddy
end repeat
end if
end repeat
end tell
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
$('#onArizonaClick').click(function(e) {
//handle here
});
</script>
@BlakeWilliams
BlakeWilliams / new.php
Created November 13, 2012 03:28 — forked from Codercise/new.php
<?php
include('../../sqlconnection/config.php');
$business = array(
"name" => $_POST['name'],
"country" => $_POST['country'],
"email" => $_POST['email'],
"phone" => $_POST['phone'],
"website" => $_POST['website'],
"tagline" => $_POST['tagline'],
"category" => $_POST['category'],
eval "$(rbenv init -)"
export PATH=/usr/local/bin:/usr/local/sbin:$PATH