sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot
http = require 'http' | |
yellIP = (callbacks, data) -> | |
console.log "OI!! YOUR IP IS #{data.ip}!!!" | |
printIP = (callbacks, data) -> | |
console.log "Your IP address: #{data.ip}" | |
parseJSON = (callbacks, string) -> | |
callbacks.shift()(callbacks, JSON.parse(string)) |
(* | |
A [native solution][1] exists but it suffers from a major flaw: it right-clicks where the cursor is, not what on the selection. | |
This code addresses that limitation, though it only works on Finder windows and not the Desktop. | |
You can install it as a [Finder Service, and later asign it a keyboard shortcut][2]. | |
[1]: http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os | |
[2]: http://www.macosxautomation.com/services/learn/tut01/index.html | |
*) |
# Dependencies | |
# | |
# $ gem install icalendar | |
# | |
# Usage | |
# | |
# $ git clone https://gist.github.com/5104840.git f1calendar | |
# $ ruby f1calendar/f1calendar.rb | |
# | |
# FORMULA 1 GRANDE PRÊMIO DO BRASIL 2015 - Sao Paulo - 2015-11-13 12:00:00 UTC - Practice 1 |
function computeSunrise(day, sunrise) { | |
/*Sunrise/Sunset Algorithm taken from | |
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm | |
inputs: | |
day = day of the year | |
sunrise = true for sunrise, false for sunset | |
output: | |
time of sunrise/sunset in hours */ |
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# Pings Apple events page until the video is posted | |
# Videos are usually live ~6 hours after official start time | |
# | |
# $ git clone https://gist.github.com/3711799.git appleevent | |
# $ ruby appleevent/appleevent.rb | |
require 'date' |
# Because we have some old legacy users in the database, we need to | |
# override #has_secure_passwords' method for checking if a password is valid. | |
# We first ask if the password is valid, and if it throws an InvalidHash | |
# exception, we know that we're dealing with a legacy user, so we check the | |
# password against the SHA1 algorithm that was used to hash the password in | |
# the old database. | |
#SOURCES OF SOLUTION: | |
# http://stackoverflow.com/questions/6113375/converting-existing-password-hash-to-devise | |
# https://github.com/binarylogic/authlogic/blob/master/lib/authlogic/crypto_providers/sha512.rb |
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/ | |
# added hackery to work around wordpress issues - Patrick Anderson (patrick@trinity-ai.com) | |
# clearly this could be cleaner, but it does work | |
require 'rack' | |
require 'rack-legacy' | |
require 'rack-rewrite' | |
# patch Php from rack-legacy to substitute the original request so | |
# WP's redirect_canonical doesn't do an infinite redirect of / |
var options, req, request; | |
request = require('request'); | |
options = { | |
uri: 'https://p04-fmfmobile.icloud.com/fmipservice/friends/{account_id}/{unique_device_id}/minCallback/selFriend/refreshClient', | |
method: 'POST', | |
headers: { | |
'X-Apple-AuthScheme': 'Forever', | |
'Content-type': 'application/json' |