Skip to content

Instantly share code, notes, and snippets.

[
{
"backcolor": "#ffd0a1",
"name": "Plank Ortholinear",
"author": "Cesare Tagliaferri",
"switchMount": "alps",
"switchBrand": "matias",
"switchType": "PG155B02",
"plate": true
},
@taglia
taglia / crawl.rake
Created June 4, 2016 08:15 — forked from tansengming/crawl.rake
Rake task to crawl you rails app for broken links
# Use this to look for broken links in your app.
# crawls the development server http://localhost:3000
# Suggestion: Also check to make sure that intentional 404s
# are handled gracefully by app.
task :crawl => :environment do
require 'anemone'
root = 'http://localhost:3000'
options = {:discard_page_bodies => true, :verbose => true}
@taglia
taglia / gist:bda623e377bfc693f55f
Created November 16, 2015 06:53 — forked from andyjbas/gist:9962218
Disable CSS Animations in Poltergeist & Phantomjs. Phantomjs does not like to wait for animations, and you can run in to nasty test flickers because of it. This pattern will disable animations in test env, and not touch any app code.
# env.rb or spec_helper.rb

Capybara.register_driver :poltergeist do |app|
  opts = {
    extensions: ["#{Rails.root}/features/support/phantomjs/disable_animations.js"] # or wherever
  }

  Capybara::Poltergeist::Driver.new(app, opts)
end
@taglia
taglia / noDoze.py
Created November 26, 2013 03:03 — forked from cclauss/noDoze.py
# noDoze.py -- keep relaunching yourself to prevent
# your iOS device from falling asleep.
import notification, time, urllib
def argsString(argv):
if len(argv) < 2: # args for first time thru
argv = [None, 0, "This is only a test..."]
argv[1] = int(argv[1]) + 1
if argv[1] > 15: # stop after 15 lifetimes!
function AttachmentCtrl($scope, $location, $timeout, Docs) {
$(function() {
$('#detail-form-doc').fileupload({
dataType: 'json',
url: '/angular-ib/app/fileupload?id=' + $location.search().id,
add: function(e, data) {
$scope.$apply(function(scope) {
// Turn the FileList object into an Array
for (var i = 0; i < data.files.length; i++) {
$scope.project.files.push(data.files[i]);
@taglia
taglia / app.js
Created November 1, 2012 10:12 — forked from prognostikos/app.js
AngularJS & Rails
/**
* Angular needs to send the Rails CSRF token with each post request.
*
* Here we get the token from the meta tags (make sure <%= csrf_meta_tags %>
* is present in your layout.)
*/
angular.module('myapp',[]).
// configure our http requests to include the Rails CSRF token
config(["$httpProvider", function(p) {
var m = document.getElementsByTagName('meta');