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a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/
#!/bin/zsh
# computer activity data collection for http://jehiah.cz/one-two/
# Originally by Jehiah Czebotar. This verison by Luca Spiller.
FILE="$HOME/Dropbox/activity_log/`hostname`-`date +%Y%m%d`.log"
function log_activity()
{
local TIME=`date "+%Y-%m-%dT%H:%M:%S%z"`
local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
class CalendarController
SKIP_DAYS = 35
constructor: (@parent, @date = moment()) ->
@parent.on 'click', '[data-direction=prev]', @movePrevious
@parent.on 'click', '[data-direction=next]', @moveNext
@parent.on 'changeDate', '[data-date-picker]', @changeDate
movePrevious: (e) =>
e.preventDefault()
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/0.8.21/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'curses' ]
2 info using npm@1.2.11
3 info using node@v0.8.21
4 verbose read json /Users/luca/code/1gam/march/package.json
5 verbose read json /Users/luca/code/1gam/march/package.json
6 verbose cache add [ 'curses', null ]
%%%-------------------------------------------------------------------
%%% File : quad_tree.erl
%%% @author Jamie Burrell
%%% @doc Erlang implementation of a quadratic tree.
%%% @end
%%% @since 2009-02-10
%%% @end
%%%-------------------------------------------------------------------
-module(quad_tree).
@lucaspiller
lucaspiller / gist:7371780
Created November 8, 2013 14:29
GitHub.app git and Homebrew git conflict
$ brew install git
zsh: correct 'git' to '.git' [nyae]? n
Warning: A newer Command Line Tools release is available
Update them from Software Update in the App Store.
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/git-1.8.4.2.mavericks.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/git-1.8.4.2.mavericks.bottle.tar.gz
==> Pouring git-1.8.4.2.mavericks.bottle.tar.gz
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
@lucaspiller
lucaspiller / Building Blink on OS X.md
Last active August 24, 2017 06:25
Building Blink on OS X
@lucaspiller
lucaspiller / gist:8952830
Created February 12, 2014 10:08
Ruby 1.8.6 crashes parsing YAML
$ ruby -v 1 ↵
ruby 1.8.6 (2009-08-04 patchlevel 383) [i686-darwin13.0.0]
$ irb -v
irb 0.9.5(05/04/13)
$ irb 134 ↵
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> YAML::load("--- !ruby/object:Gem::Specification\nname: multi_xml\nversion: !ruby/object:Gem::Version\n version: 0.5.1\n prerelease: \nplatform: ruby\nauthors:\n- Erik Michaels-Ober\nautorequire: \nbindir: bin\ncert_chain: []\ndate: 2012-05-10 00:00:00.000000000 Z\ndependencies:\n- !ruby/object:Gem::Dependency\n name: maruku\n requirement: !ruby/object:Gem::Requirement\n none: false\n requirements:\n - - ! '>='\n - !ruby/object:Gem::Version\n version: '0'\n type: :development\n prerelease: false\n version_requirements: !ruby/object:Gem:
@lucaspiller
lucaspiller / auto-save-remote-images.php
Created February 19, 2014 15:19
Auto Save Remote Images WP Plugin
<?php
/*
Plugin Name: Auto Save Remote Image
Plugin URI: http://www.devsaab.com/wordpress/
Description: This plugin automatically downloads the first remote image from a post and sets it as the featured image.
Version: 1.3
Author: Prebhdev Singh
Disclaimer: No warranty or guarantee of any kind! Use this in your own risk.
*/
add_action('publish_post', 'fetch_images');
@lucaspiller
lucaspiller / rss.xml
Created February 26, 2014 13:56
Octopress, export all posts as RSS
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" xmlns:atom="http://www.w3.org/2005/Atom"/>
<title>{{ site.title | xml_escape }}</title>
<generator>Octopress</generator>
<link>{{ site.url }}</link>