I hereby claim:
- I am sstarr on github.
- I am sstarr (https://keybase.io/sstarr) on keybase.
- I have a public key whose fingerprint is 0A09 E5BF 1F8E 14F7 B703 53A7 77A7 384A BBA0 C7AE
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| class Profile < ActiveRecord::Base | |
| # ... | |
| def format_twitter_url | |
| unless self.twitter_url.blank? || self.twitter_url[/^https?:\/\//] | |
| if self.twitter_url[/twitter\.com/i] | |
| self.twitter_url = 'http://' + self.twitter_url | |
| else | |
| self.twitter_url = "https://twitter.com/#{self.twitter_url.sub(/@/, '')}" |
| execute pathogen#infect() | |
| syntax on | |
| filetype plugin indent on | |
| " 256 colours, please | |
| set t_Co=256 | |
| " Dark twilight scheme | |
| set background=dark | |
| colorscheme twilight256 |
| box: wercker/ruby | |
| services: | |
| - wunki/[email protected] | |
| - wercker/postgresql | |
| build: | |
| steps: | |
| # Taken from https://gist.github.com/pjvds/6008266 | |
| - script: |
| # - A `Thing` can be 1% - 100% green | |
| # - This is represented on the front end with a doughnut chart | |
| # - The doughnut chart can't be generated since it's in an email | |
| # - To get around this, we have 25 static doughnut images in increments of 4% | |
| # This code takes the percentage and returns the relevant image. | |
| # I'm sure there must be a more sensible way of doing this than using the | |
| # world's longest switch statement. Any ideas? |
| colour = "##{((0..6).map{rand(256).chr}*'').unpack('H*')[0][0,6]}" | |
| # => "#9ee5a3" |
| @from_date = Date.parse("1/10/2013") | |
| @to_date = Date.parse("31/10/2013") | |
| date_range = [*@from_date..@to_date] | |
| prepend = (date_range)[0].wday # 2 | |
| append = (date_range)[-1].wday # 4 | |
| weeks = (date_range).unshift(*2..prepend).push(*2..append).each_slice(7).to_a | |
| # [ | |
| # [0] [ |
| [ | |
| { | |
| "keys": ["escape"], | |
| "command": "alternative_autocomplete", | |
| "context": [ | |
| {"key": "num_selections", "operator": "equal", "operand": 1}, | |
| {"key": "overlay_visible", "operator": "equal", "operand": false}, | |
| {"key": "panel_visible", "operator": "equal", "operand": false}, | |
| {"key": "has_prev_field", "operator": "equal", "operand": false}, | |
| {"key": "has_next_field", "operator": "equal", "operand": false}, |
| ["Ækvatorialguinea", "Afghanistan", "Albanien", "Algeriet", "Amerikansk Samoa", "Andorra", "Angola", "Anguilla", "Antarktis", | |
| "Antigua og Barbuda", "Argentina", "Armenien", "Aruba", "Aserbajdsjan", "Australien", "Bahamas", "Bahrain", "Bangladesh", | |
| "Barbados", "Belarus", "Belgien", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnien-Hercegovina", "Botswana", | |
| "Bouvetø", "Brasilien", "Brunei", "Bulgarien", "Burkina Faso", "Burundi", "Côte d'Ivoire", "Cambodja", "Cameroun", "Canada", | |
| "Caymanøerne", "Chile", "Cocosøerne (Keelingøerne)", "Colombia", "Comorerne", "Congo", "Cookøerne", "Costa Rica", "Cuba", | |
| "Cypern", "Danmark", "De Amerikanske Jomfruøer", "De Britiske Jomfruøer", "De Forenede Arabiske Emirater", | |
| "De Franske Besiddelser i Det Sydlige Indiske Ocean", "De Mindre Amerikanske Oversøiske Øer", "De Nederlandske Antiller", | |
| "Den Centralafrikanske Republik", "Den Dominikanske Republik", "Den Tidligere Jugoslaviske Republik Makedonien", | |
| "Det Britiske Territorium i Det Indiske Ocean", "Det Forene |
| # Generate Twitter Bootstrap icons with a minimum of fuss | |
| # Use in views like so: | |
| # icon('pencil') => content_tag(:i, '', class: 'icon-pencil') | |
| # icon('trash', 'icon-white huge') => content_tag(:i, '', class: 'icon-trash icon-white huge') | |
| def icon(style, extra_class = nil) | |
| content_tag(:i, '', class: "icon-#{style}" + (extra_class ? " #{extra_class}" : '')) | |
| end |