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
},

Keybase proof

I hereby claim:

  • I am taglia on github.
  • I am taglia (https://keybase.io/taglia) on keybase.
  • I have a public key ASAwdgqHSrgH6XDAQK2rV9bPw9JZloIJWUroFA_bMkxKEAo

To claim this, I am signing this object:

@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 / sha1.rb
Created January 8, 2014 10:21
Compute SHA1 hash of the file given as first argument. Reads big files in chunks to avoid using all the available memory.
require 'openssl'
file_name = ARGV.first
digest = OpenSSL::Digest::SHA1.new
file = File.open(file_name, "rb")
until file.eof?
print "#"
digest.update file.read(2**24)
@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!
@taglia
taglia / Org-mode – Moving forward
Last active December 21, 2015 05:09
Snippets of code for OSOMac's post Org-mode – Moving forward
Snippets of code for OSOMac's post Org-mode – Moving forward
@taglia
taglia / AddLinkToMessageInClipboard.vb
Last active May 3, 2016 15:01
See the README below for more details. This gist is linked from this blog post: http://www.osomac.com/2013/07/14/farewell-omnifocus-welcome-org-mode-pt-2/
'Move the selected message to an archive folder,
'Then Adds an org-mode friendly link to the message to the clipboard
Sub AddLinkToMessageInClipboard()
Dim objMail As Outlook.MailItem
Dim doClipboard As New DataObject
Dim destFolder As Outlook.MAPIFolder
Dim nameSpace As Outlook.nameSpace
Dim inBox As Outlook.MAPIFolder
Dim app As New Outlook.Application
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');