Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / ecs-docker-cleanup.sh
Created July 11, 2018 00:07
ECS Docker Cleanup
date;
docker ps -q --filter "status=exited" | xargs --no-run-if-empty docker rm;
docker volume ls -qf dangling=true | xargs -r docker volume rm;
@ifnull
ifnull / example.js
Created May 3, 2018 18:10
Dialogflow Sample Custom Payload
return {
fulfillmentText: response,
fulfillmentMessages: [
],
"payload": {
"google": {
"richResponse": {
"items": [
{
"simpleResponse": {
(function() {
var core = {
dt: !1,
isFrame: top != self,
modules: [],
opts: [],
options: {},
start: null,
$: null,
now: function() {
@ifnull
ifnull / slack_delete_poc.sh
Created March 21, 2018 19:58
Test to pull tokens from keychain and delete all conversations
brew install jq
pip install slack-cleaner
SLACK_TOKENS=$(security find-generic-password -w -s "Slack")
for row in $(echo "${SLACK_TOKENS}" | jq -r '[.[].token]'); do
TOKEN=$(echo ${row} | sed 's/"//g')
echo $TOKEN
slack-cleaner --token ${TOKEN} --message --channel foobar --user foobar
done
@ifnull
ifnull / gist:eb9bcab5bac05ae9831d00123f4427ca
Created December 6, 2017 01:44
PHP Naming Conventions by Project
╔═══════════════════════╦═════════════╦════════════╦══════════════╦════════════╦════════════╗
║ PHP Project ║ Classes ║ Methods ║ Properties ║ Functions ║ Variables ║
╠═══════════════════════╬═════════════╬════════════╬══════════════╬════════════╬════════════╣
║ Akelos Framework ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║
║ CakePHP Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
║ CodeIgniter Framework ║ Proper_Case ║ lower_case ║ lower_case ║ lower_case ║ lower_case ║
║ Concrete5 CMS ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║
║ Doctrine ORM ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
║ Drupal CMS ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║
║ Joomla CMS ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
@ifnull
ifnull / README.md
Created October 8, 2017 04:53
Supervisor + Ngrok
apt-get install supervisor ngrok

Create the config files

  • /root/.ngrok2/ngrok.yml
  • /etc/supervisor/conf.d/ngrok.conf
supervisorctl reread
@ifnull
ifnull / example.js
Created July 24, 2017 04:26
Get POV heading for StreetViewPanorama
function initialize() {
// initialize the geocoder API functions. We need this to convert the address to a geolocation (GPS coordinates)
var geocoder = new google.maps.Geocoder();
// then we call the geocode function with the address we want to use as parameter
geocoder.geocode( { 'address': '20 River Terrace, New York, NY, United States' }, function(results, status) {
// set the lookTo var to contain the coordinates of the address entered above
var lookTo = results[0].geometry.location;
// if the address is found and the geocoder function returned valid coordinates
if (status == google.maps.GeocoderStatus.OK) {
// set the options for the panorama view
@ifnull
ifnull / spoof.sh
Created September 7, 2016 21:04
Spoof Mac Address
sudo su
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z;
ifconfig en0 down;
ifconfig en0 up;
sleep 10;
ifconfig en0 ether aa:bb:cc:dd:ee:ff;
networksetup -detectnewhardware;
@ifnull
ifnull / git-reset-develop.sh
Created June 23, 2016 22:37
Git refresh develop from master
# Delete your local develop
git checkout master
git branch -D develop
# Recreate your local develop, based on origin's master
git pull origin master
git checkout -b develop
# Push and overwrite the sloppy develop on the origin
git push origin develop --force