Skip to content

Instantly share code, notes, and snippets.

View ssx's full-sized avatar

Scott Robinson ssx

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ssx on github.
  • I am ssx (https://keybase.io/ssx) on keybase.
  • I have a public key whose fingerprint is F09E ADA7 71CD 1D46 9AB2 53A0 7C74 DD9C 936C 050C

To claim this, I am signing this object:

Test String:
< echo "Hello O'Test"; ?>
FILTER_SANITIZE_STRING:
string(0) ""
FILTER_UNSAFE_RAW with flags: FILTER_FLAG_STRIP_LOW,
FILTER_FLAG_STRIP_HIGH,
FILTER_FLAG_ENCODE_LOW,
FILTER_FLAG_ENCODE_HIGH,
Answers Needed:
1. What Name generally has the most spaces
2. What time of day is 'name' likely to have spaces
3. What name generally has the least spaces
Date Time Name Spaces
2014-10-01 10:00:00 Item 1 753
2014-10-01 10:00:00 Item 2 436
@ssx
ssx / gist:e1b617045741b43fd00c
Last active August 29, 2015 14:07
Sample Structure
about
-- subject 1
-- subject 2
news
-- n number of posts/articles
projects
-- area 1
-- project name 1
-- project name 2
-- project name 3
@ssx
ssx / gist:93bb311a3dfa963f8af7
Last active February 17, 2018 20:50
Forge Deploy Script
cd /home/forge/example.com
git pull origin master
composer install
php artisan migrate --force
chmod -R 777 app/storage
HOST=$(hostname)
MESSAGE=$(git show -s --format=%B)
SHA=$(git rev-parse --verify HEAD)
SHA="==== New Deploy ==== \n\n *Server*: $HOST\n*Site*: example.com\n*Deployment Commit:* https://server/username/project/commit/$SHA\n*Message:*\n\n$MESSAGE"
curl -X POST --data-urlencode 'payload={"channel": "#deploy", "username": "Laravel Forge", "text": "'"$SHA"'", "icon_emoji": ":shipit:"}' https://hooks.slack.com/services/link/with/token
--------------------------------------------------
--------------------------------------------------
-- Import tasks from Things to OmniFocus
--------------------------------------------------
--------------------------------------------------
--
-- Script taken from: http://forums.omnigroup.com/showthread.php?t=14846&page=2
-- Added: creation date, due date, start date functionality
-- Empty your Things Trash first.
-- Note that this won't move over scheduled recurring tasks.
<html>
<head>
<title>Coffee Generator</title>
<style type="text/css">
body {
background: #f3r3e3;
font-size: 40px;
text-align: center;
color: #000;
}
@ssx
ssx / logstash.conf
Created October 24, 2015 15:09
Laravel Logs to Logstash
input {
lumberjack {
port => 5000
type => "logs"
ssl_certificate => "/shared/logstash-certs/logstash-forwarder.crt"
ssl_key => "/shared/logstash-certs/logstash-forwarder.key"
}
}
## Add your filters here
@ssx
ssx / gist:9be3f4e7d7ad11d31d69
Created October 24, 2015 15:35
Logstash Grok Filter for Laravel Logs
filter {
# Laravel log files
if [type] == "laravel" {
grok {
match => { "message" => "\[%{TIMESTAMP_ISO8601:timestamp}\] %{DATA:env}\.%{DATA:severity}: %{DATA:message} \[" }
}
}
}