Skip to content

Instantly share code, notes, and snippets.

View eriwen's full-sized avatar

Eric Wendelin eriwen

View GitHub Profile
@eriwen
eriwen / flip-in.css
Created December 16, 2013 16:45
Flip-in CSS transform
.activities-header, .chart-header, .activities-list, .activities-chart, .map-container {
opacity: 0.01;
perspective: 400px;
perspective-origin: 50% 50%;
transform-origin: 0% 100%;
transform: rotateX(-80deg);
}
.activities-header, .chart-header {
transition: all 200ms ease, opacity 100ms ease;
@eriwen
eriwen / custom-events.js
Created December 16, 2013 16:27
JavaScript Events example
$(document).on('gnip:activitiesloaded', this.showActivities);
$(document).on('gnip:activitieserror', this.showError);
function showActivities(eventObj, tweets) {
// Render le tweets
}
function showError() {...}
{
"id":"tag:search.twitter.com,2005:181865366610382848",
"body":"No one wants to carry laptops any more, but we lose IPads and they are not secure. The Sweden PM ran the country for a week on an ipad.",
"verb":"post",
"link":"http://twitter.com/ProfNikiEllis/statuses/181865366610382848",
"generator":{
"link":"http://twitter.com/#!/download/ipad",
"displayName":"Twitter for iPad"
},
"postedTime":"2012-03-19T22:10:56.000Z",
@eriwen
eriwen / test.gradle
Created March 26, 2013 14:47
Separating tests from integration tests with Gradle
// Usage: gradlew [-Dtest.type=all|unit|integration] test
test {
String testType = System.properties['test.type']
if (testType == 'integration') {
include '**/*IntegrationTest.*'
include '**/*IntegrationSpec.*'
} else if (testType == 'unit') {
include '**/*Test.*'
include '**/*Spec.*'
@eriwen
eriwen / pre-commit
Last active January 13, 2021 08:22
Pre-commit git hook for tracking new TODO/FIXME comments
#!/usr/bin/ruby
$refname = ARGV[0]
$oldrev = ARGV[1]
$newrev = ARGV[2]
def tasks
puts 'Checking TODOs...'
todo_pattern = /^\s*\+\s*([\/\#]+|<\!\-\-)\s*(FIXME|TODO)\W*([\s\w]+)(\-\->)?$/
# Find task-oriented comments added with this commit
@eriwen
eriwen / scale.sass
Created January 2, 2013 02:54
Interesting page type/size scaling idea
@media screen and (min-width: 64.375em)
body
font-size: 137.5%
max-width: 46rem
width: 60%
@media screen and (min-width: 50em)
body
font-size: 125%
width: 70%
@eriwen
eriwen / respond-to-mixin.sass
Created December 13, 2012 17:07
This is an enhanced version of the 'respond-to' sass mixin I stole from here: http://t.co/3KitZ6hI
$handheldPortraitWidth: 480px
$handheldLandscapeWidth: 768px
$tabletPortraitWidth: $handheldLandscapeWidth
$tabletLandscapeWidth: 980px
$smallDesktopWidth: 1200px
$largeDesktopWidth: 1600px
=respond-to($media)
@if $media == handheld-portrait
@media only screen and (max-width: $handheldPortraitWidth)
require "em-http-request"
EM.run {
http = EM::HttpRequest.new("http://localhost:1234/file.gz").get
http.errback { EM.stop }
http.callback { EM.stop }
}
@eriwen
eriwen / gist:3160718
Created July 22, 2012 19:02
Prevent dependency version conflicts
apply plugin: 'java'
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force 'org.springframework:spring-core:3.1.RELEASE'
}
}
@eriwen
eriwen / warble.sh
Created July 17, 2012 22:34
Jenkins shell command to build WAR with JRuby
source /usr/share/ruby-rvm/scripts/rvm
rvm use jruby
bundle install
jruby -S warble