Skip to content

Instantly share code, notes, and snippets.

View lukeholder's full-sized avatar
👾

Luke Holder lukeholder

👾
View GitHub Profile
@lukeholder
lukeholder / compare.html
Last active December 15, 2015 04:29
craft update form with GUID
THIS:
<form method="post" action="" accept-charset="UTF-8">
<input type="hidden" name="action" value="entries/saveEntry">
<input type="hidden" name="redirect" value="blog/{{ entry.slug }}">
<input type="hidden" name="GUID" value="{{ entry.guid }}">
<label for="title">Title</label>
<input id="title" type="text" name="title" value="{{ entry.title }}">
<?php
namespace BlocksCommerce\Models;
use Blocks\AttributeType;
use Blocks\Blocks;
class PaymentMethodModel extends BaseModel
{
public function __toString()
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
@lukeholder
lukeholder / test.rb
Created January 31, 2013 01:26
this is a test
def playing_with_sublime_text_gist_maker
puts "working?"
end
@lukeholder
lukeholder / demo.rb
Created January 11, 2013 06:53
How to connect to Microsoft SQL Server with jruby on Windows using JDBC and Sequel Gem
require "java"
require "rubygems"
require "sequel"
require "sqljdbc4.jar" #this files path may need to be relevate to file location
DB = Sequel.connect(
:adapter => "jdbc",
:url => "jdbc:sqlserver://doric-server5;database=ADCData_Doric;integratedSecurity=true"
# This is using integrated security, might want to pass username and password
# More Info at http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
@lukeholder
lukeholder / problem.ee
Created December 21, 2012 03:12
#eecms error
this works:
{exp:channel:entries channel="news" limit="10"}
<div class="item">
<div class="item-city">{title}</div>
<div class="votes"></div>
</div>
{/exp:channel:entries}
this does not:
@lukeholder
lukeholder / sharing.md
Created December 4, 2012 07:46 — forked from danott/sharing.md
Sharing Buttons Reference

Pinterest

Documentation

<!-- An individual link -->
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Funitedway.com&media=http%3A%2F%2Fplacehold.it%2F200x200&description=A%20description." class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>

<!-- before </body> -->
@lukeholder
lukeholder / environment.md
Last active October 13, 2015 13:17
Luke Holder's Development Environment

Luke Holder's Development Environment.

Hardware

  • 15" Retina Macbook Pro
  • Thunderbolt Display
  • Apple Wireless Keyboard
  • Magic Mouse
@lukeholder
lukeholder / PrintsOfWhales.rb
Created November 28, 2012 06:53
PrintsOfWhales
def random_home_page_blurb (blurbs)
selected_blurb = blurbs.sample
output = "<span class='heading letterspaced txtshadow-light'>#{selected_blurb[:setup]}</span><br /><br />"
output << "<span class='subheading letterspaced txtshadow-light'>#{selected_blurb[:punchline]}<span>"
span.html_safe
end
@lukeholder
lukeholder / statetoggle.coffee
Created November 15, 2012 07:09
toggle needs state
changeTagState = (newstate, elem) ->
$item = $(elem).parent()
$icon = $item.find('i')
$icon.removeClass().addClass('icon-ok') if newstate == 'on'
$icon.removeClass().addClass('icon-remove') if newstate == 'off'
$icon.removeClass().addClass('icon-tag') if newstate == 'none'
oldstate = $item.data('state')
oldclass = "state-"+oldstate
newclass = 'state-'+newstate
$item.addClass(newclass)