Skip to content

Instantly share code, notes, and snippets.

View skyzyx's full-sized avatar
👾
OOICU812

Ryan Parman skyzyx

👾
OOICU812
View GitHub Profile
@skyzyx
skyzyx / install-composer.sh
Last active July 19, 2018 22:25
Install #Composer for Mac/Linux
curl -S https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer \
| php -- --install-dir=/usr/local/bin --filename=composer
@skyzyx
skyzyx / strftime-php71-alpine.sh
Created July 24, 2017 18:14
strftime() %P modifier broken in PHP 7.1.7 on Alpine Linux 3.4
# Working
docker run -ti php:7.1.7-fpm-alpine php -r "var_dump(strftime('%c', time()));"
#=> string(24) "Mon Jul 24 18:09:54 2017"
# Also working
docker run -ti php:7.1.7-fpm-alpine php -r "var_dump(strftime('%I:%M%p', time()));"
#=> string(7) "06:12PM"
# Not working
docker run -ti php:7.1.7-fpm-alpine php -r "var_dump(strftime('%I:%M%P', time()));"
@skyzyx
skyzyx / metadata
Last active August 30, 2017 00:09
SimplePie: Individual Contributor Non-Exclusive License Agreement including the Patent Pledge OPTION
{
"name": {
"title": "Full Name",
"type": "string",
"githubKey": "name",
"required": true
},
"email": {
"title": "Email",
"type": "string",
@skyzyx
skyzyx / engineering-roles.md
Created December 11, 2017 19:58
Engineering Role Definitions

Engineering Role Definitions

Note: Although the levels may be different, these tend to map pretty cleanly to similar hierarchies at Google and Microsoft, but they have no correlation to hierarchies outside of the "club" of elite companies (Microsoft/Amazon/Google/Facebook, etc. on the west coast, Bloomberg/Goldman/HFT firms, etc. on the east coast).

People with 10-15 years of software engineering experience interview all the time at these companies, but they may not be fit for much more than a junior engineering role (SDE I or SDE II, depending on which company you're looking at).

Junior Engineer/Intern:

  • Is essentially a new and inexperienced (below the level of Amazon/Microsoft/Google engineers) junior engineer.
  • Attending college for computer science, or really good at teaching themselves from books and online tutorials.
/*[translate(name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'rss']
@skyzyx
skyzyx / sample-xpath-translate-faster.php
Last active July 19, 2018 21:53
Faster case-insensitive #XPath matches in #PHP
<?php
$word = 'rss';
$elementLetters = \count_chars($word, 3);
$lettersLower = \mb_strtolower($elementLetters);
$lettersUpper = \mb_strtoupper($elementLetters);
$query = \sprintf(
'/*[translate(name(), \'%s\', \'%s\') = \'%s\']',
$lettersUpper,
@skyzyx
skyzyx / docker-port-mapping.sh
Created July 19, 2018 22:20
#Docker mapping of open ports
docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}}{{$p}} -> {{(index $conf 0).HostPort}} {{end}}' d7aab3bcecd4
@skyzyx
skyzyx / dopcker-ipaddress-mapping.sh
Created July 19, 2018 22:21
#Docker mapping of IP addresses
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d7aab3bcecd4
@skyzyx
skyzyx / docker-datadog.sh
Created July 19, 2018 22:23
#Docker Engine API for #Datadog Agent
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/{id}/top" | jq
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/json" | jq -r '.[] | select(.Image == "datadog/agent") | .NetworkSettings.Networks.bridge.IPAddress'
curl -sSL --unix-socket /var/run/docker.sock "http:/v1.37/containers/json" | jq -r '.[] | select(.Image == "datadog/agent") | .Ports[] | select(.PublicPort) | .PublicPort'
curl -sSL \
--unix-socket /var/run/docker.sock \
"http:/v1.37/containers/json" \
| jq -r '
@skyzyx
skyzyx / lambda-sumologic.sh
Created July 19, 2018 22:25
Remove all #CloudWatch Log Groups for #Lambda functions forwarding to #SumoLogic
for lg in $(aws logs describe-log-groups --query "logGroups[?logGroupName | contains(@, 'aws/lambda/sumologic')].logGroupName" --output text); do
echo "$lg";
aws logs delete-log-group --log-group-name "$lg";
done;