Skip to content

Instantly share code, notes, and snippets.

fbrnc / gist:bdade1df328c3f766a3c
Last active Jul 7, 2021
Magento XML Connect Demo
View gist:bdade1df328c3f766a3c
// Initialize
$app = new SimpleHttpClient('http://www.demo.local/xmlconnect/');
$app->addCookie('app_code', 'INSERT APP CODE HERE');
$app->addCookie('screen_size', '600x400');
// get products in category 3
fbrnc / send-receive-sqs.php
Last active May 26, 2021
Sending and receiving messages from/to AWS SQS via PHP
View send-receive-sqs.php
// curl -sS | php
// php composer.phar require aws/aws-sdk-php
// export AWS_ACCESS_KEY_ID=...
fbrnc / counter.js
Created Jun 9, 2016
Simple hit counter with node.js and Redis
View counter.js
var db = require("redis-client").createClient();
require("http").createServer(function(request, response) {
db.incr("count",function(err, reply) {
response.writeHead(200, { "Content-Type": "text/plain" });
fbrnc / consumer.php
Last active Oct 1, 2020
AWS Kinesis Example for PHP (using the AWS SDK for PHP)
View consumer.php
// curl -sS | php
// php composer.phar require aws/aws-sdk-php
// export AWS_ACCESS_KEY_ID=...
$numberOfRecordsPerBatch = 10000;
function dotenv --description 'Load environment variables from .env file'
set -l envfile ".env"
if [ (count $argv) -gt 0 ]
set envfile $argv[1]
if test -e $envfile
for line in (cat $envfile | grep -v '^#' | grep -v '^$')
set -xg (echo $line | cut -d = -f 1) (echo $line | cut -d = -f 2-)
fbrnc / cw_exp.js
Created Mar 4, 2016
AWS Lambda function that collects relevant metrics from CloudWatch and pushes them to ElasticSearch
View cw_exp.js
var AWS = require('aws-sdk');
var cloudwatch = new AWS.CloudWatch({ region: 'us-east-1'});
exports.handler = function (event, context) {
var ElasticSearchHost = 'elasticsearch.example:9200';
var Environment = 'int';
var EndTime = new Date;
var StartTime = new Date(EndTime - 15*60*1000);
var Metrics = {
fbrnc / gitlog2elasticsearch.php
Last active Nov 16, 2019
git log to Elasticsearch
View gitlog2elasticsearch.php
cd /var/hackathon/projects
for i in `find . -maxdepth 1 -mindepth 1 -type d`; do
project=`echo $i | sed 's/\.\///g'`
cd "/var/hackathon/projects/$project"
echo "Updating project $project"
git pull
php /var/hackathon/gitlog2elasticsearch.php http://localhost:9200/hackathon/commit/ "$project" '2 days ago'
fbrnc / gist:66f9753144a5ea8db0c1
Created Jul 4, 2014
Jenkins Build Pipeline Custom CSS
View gist:66f9753144a5ea8db0c1
#build-pipeline-plugin-content {
background-color: none;
border-radius: 0;
#build-pipeline-plugin-content h1 {
display: none;
tbody.pipelineGroup {
fbrnc / gist:7645313
Last active Jan 10, 2019
Reset Magento EE changelogs
View gist:7645313
truncate catalog_product_flat_cl;
truncate catalog_category_product_index_cl;
truncate catalog_category_product_cat_cl;
truncate catalog_category_flat_cl;
truncate catalogsearch_fulltext_cl;
truncate cataloginventory_stock_status_cl;
truncate catalog_product_flat_cl;
truncate catalog_product_index_price_cl;
truncate enterprise_url_rewrite_category_cl;
truncate enterprise_url_rewrite_product_cl;

Keybase proof

I hereby claim:

  • I am fbrnc on github.
  • I am fbrnc ( on keybase.
  • I have a public key ASB3WTuY4rB_v4d3YnnCk5vrK16eY-f6I0GfoWBkWywtQAo

To claim this, I am signing this object: