This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^/(wp-admin|wp-login\.php|priv\.dog|companies\/sidekick) { | |
deny all; | |
break; | |
} | |
# file extensions that should never be served, this prevents | |
# potential malicious downloads in case someone manages to manipulate | |
# a Rails URL or write a file that can be served | |
# (~* matches case-insensitive) | |
location ~* \.(?:git|svn|DS_Store|asp|aspx|cgi|pt|pl|idx|php|exe|scpt|AppleScript|dll|dmg|pif|msi|application|msp|com|scr|hta|cpl|gadget|msc|jar|bat|vb|vbs|vbe|ws|wsh|inf|lnk|reg|scf|wsc|wsh|ps1|ps1xml|ps2|ps2xml|psc1|psc2|msh|msh1|msh2|mshxml|msh1xml|msh2xml)$ { | |
deny all; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Symlink release to be current version | |
sudo: yes | |
shell: > | |
rm -f {{ freckle_current_path }} && | |
ln -s {{ release_path }} {{ freckle_current_path }} | |
notify: | |
- restart unicorn | |
- restart resque-worker | |
- restart resque-priority-worker | |
when: (new_release|changed) and ('appservers' in group_names) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
letters = "" | |
letters << user.first_name[0,1] if user.first_name.size > 1 && 'A'..'Z'.include?(user.first_name[0,1].upcase) | |
letters << user.last_name[0,1] if user.last_name.size > 1 && 'A'..'Z'.include?(user.last_name[0,1].upcase) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This requires "imagemin", install via: | |
# npm install --global imagemin | |
echo "Cleaning up..." | |
rm -rf build | |
mkdir build | |
echo "Optimizing SVG..." | |
imagemin *.svg ../public/images/icons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
FILENAME = "../app/helpers/icon_helper.rb" | |
JAVASCRIPT_HELPER = "../public/js/icons/icons.js" | |
puts "Generating helper #{FILENAME}" | |
File.open(FILENAME, 'w') do |helper| | |
helper.write "module IconHelper\n\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.carriage_returns_to_newlines!(file_contents) | |
(file_contents.gsub!(/\r\n/,"\n")||file_contents).gsub!(/\r/, "\n") || file_contents | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- iPhone 6 Plus --> | |
<link href="startup-image-1242x2148.png" | |
media="(device-width: 414px) and (device-height: 736px) | |
and (-webkit-device-pixel-ratio: 3)" | |
rel="apple-touch-startup-image"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Controllers | 6115 | 4880 | 48 | 436 | 9 | 9 | | |
| Helpers | 1534 | 1214 | 1 | 175 | 175 | 4 | | |
| Models | 10394 | 8021 | 106 | 1126 | 10 | 5 | | |
| Libraries | 2098 | 1519 | 28 | 186 | 6 | 6 | | |
| Integration tests | 1419 | 1054 | 12 | 6 | 0 | 173 | | |
| Functional tests | 13650 | 10437 | 28 | 71 | 2 | 145 | | |
| Unit tests | 21981 | 17809 | 41 | 73 | 1 | 241 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def format_date_range(from, to) | |
to = from if to.nil? | |
return '' if from.nil? && to.nil? | |
from, to = to, from if to < from | |
if from == to | |
from.strftime('%B %e, %Y') | |
elsif from.year == to.year && from.month == to.month && | |
from.beginning_of_month == from && to.end_of_month == to | |
from.strftime('%B %Y') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('dragover', function(e){ | |
e.preventDefault(); | |
e.stopPropagation(); | |
}, false); | |
document.addEventListener('drop', function(e){ | |
e.preventDefault(); | |
e.stopPropagation(); | |
}, false) |