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: CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
deploy: | |
name: deploy | |
runs-on: ubuntu-latest |
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
import urllib2 | |
def cronjob_handler(event, context): | |
url = 'http://mywebsite.com/schedules?authtoken=someRandomString' | |
urllib2.urlopen(url).read() |
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
# Replace "http://www.example.com" before running this command | |
for X in 'seq 60'; do curl -Ik -w "HTTPCode=%{http_code} TotalTime=%{time_total}\n" http://www.example.com/ -so /dev/null; done |
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
watch -n 1 "echo -n 'Apache Processes: ' && ps -C apache2 --no-headers | wc -l && free -m" |
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 removeNonAscii($string) { | |
$regex = "/[^\x{0000}-\x{007F}]+/"; | |
return preg_replace($regex, '', $string); | |
} |
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
# you may not need to run it with sudo | |
sudo pip install --ignore-installed --upgrade awsebcli |
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
var LabInput = { | |
refresh() { | |
setTimeout(() => { | |
$('.labinput').each(function () { | |
let label = $('label', this), | |
input = $('input', this); | |
// Check if it has a clearable class | |
if ($(this).hasClass('clearable')) { | |
let x = $(`<div class="clear-input">×</div>`); |
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
# After updating OS X (from 10.10 to 10.11), MAMP didn't started the apache server (complaining apache was already running) | |
# The solution found on the internet is correct, but.... | |
# sudo apachectl stop | |
# ...that the command will try to stop MAMP apache (not the built-in httpd service) | |
# The correct solution is to unload the correct apache | |
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist |
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 namespace App\Http\Middleware; | |
use Closure; | |
/** | |
* Put this file in app/Http/Middleware | |
* Read more here https://github.com/peppeocchi/laravel-elb-middleware | |
* | |
*/ | |
class ElasticBeanstalkHttps |
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
# in .htaccess | |
Order deny,allow | |
Deny from all | |
# if elastic beanstalk | |
SetEnvIF X-Forwarded-For "MY.IP.TO.BLOCK" blocked_ips | |
Order deny,allow | |
Deny from env=blocked_ips | |
# *nix iptables |
NewerOlder