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
web: vendor/bin/heroku-php-apache2 public/ |
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
Sort the characters in the following string: | |
abcdefghijklmnopqrstuvwxyz_ | |
by the number of times the character appears in data.txt | |
Now take the sorted string, and drop all the characters after (and including) the _. | |
The remaining word is the answer. | |
Download including Swift Playground: |
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
<?php | |
function PhoneFormat($phone) { | |
$prefix = ''; | |
$phone = preg_replace('/\D/', '', $phone); | |
$dash = strlen($phone); | |
if ($dash > 10) { | |
if (strpos($phone, '10') === 0 || strpos($phone, '11') === 0) { | |
$prefix = substr($phone, 0, 2); |
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
- (void)viewDidLoad:(BOOL)animated { | |
[super viewDidLoad:animated]; | |
self.numberFormatter = [[NSNumberFormatter alloc] init]; | |
[self.numberFormatter setNumberStyle:NSNumberFormatterNoStyle]; | |
[self.numberFormatter setGroupingSize:2]; | |
[self.numberFormatter setGroupingSeparator:@":"]; | |
[self.numberFormatter setUsesGroupingSeparator:YES]; | |
[self.numberFormatter setMaximumFractionDigits:0]; | |
[self.numberFormatter setMinimumIntegerDigits:6]; |
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
class Admin::ContestsController < ApplicationController | |
def draw | |
redirect_to(root_url, :alert => 'Unauthorized') and return unless(current_user.present? && current_user.admin?) | |
contestants = Contestant.select([:id, :points]).elegible.for_contest(params[:id]) | |
entries = [] | |
contestants.each { |c| c.points.times { entries << c.id } } | |
unless entries.blank? | |
entries.shuffle! |
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
apt-get update | |
apt-get upgrade | |
apt-get dist-upgrade | |
# /var/run/reboot-required ? | |
adduser $USER | |
# usermod -a -G www-data $USER | |
# Setup ~/.ssh/authorized_keys | |
# /usr/sbin/visudo |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
1 HUP (hang up) | |
2 INT (interrupt) | |
3 QUIT (quit) | |
6 ABRT (abort) | |
9 KILL (non-catchable, non-ignorable kill) | |
14 ALRM (alarm clock) | |
15 TERM (software termination signal) | |
PID -1 sends signal to all processes if superuser, just those belonging to the user otherwise. |
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
https://en.wikibooks.org/wiki/OpenSSH/Cookbook/SFTP | |
Subsystem sftp internal-sftp | |
Match Group sftp-users | |
ChrootDirectory /home | |
AllowTCPForwarding no | |
X11Forwarding no | |
ForceCommand internal-sftp -d %u | |
groupadd --system sftp-users |
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
https://unix.stackexchange.com/questions/12985/how-to-check-rx-ring-max-backlog-and-max-syn-backlog-size | |
Jason Cook - Tuning TCP for the Web - Fastly | |
https://vimeo.com/70369211 | |
http://cdn.oreillystatic.com/en/assets/1/event/94/Tuning%20TCP%20For%20The%20Web%20Presentation.pdf | |
https://www.youtube.com/watch?v=gfYYggNkM20 | |
https://wiki.mikejung.biz/Sysctl_tweaks | |
https://wiki.mikejung.biz/Apache |
NewerOlder