Skip to content

Instantly share code, notes, and snippets.

@sameg14
sameg14 / samir_patel_resume_poem
Created October 11, 2023 20:46
Samir's Resume Poem
In a world of bytes and lines, I tread,
A Staff Infrastructure Engineer, where I've led.
Clouds and code, my daily creed,
A journey woven with skills, it's my steed.
Kubernetes, Terraform, and Docker in my hand,
I sculpt infrastructure in a digital land.
AWS and GCP, clouds at my command,
With Ansible and Puppet, I firmly stand.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: tetris
spec:
replicas: 1
template:
metadata:
labels:
app: tetris
@sameg14
sameg14 / composer.json
Created September 14, 2016 03:28
Failing composer.json
{
"name": "ReStream Solutions API",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
{ "id": "1001", "type": "Regular" },
@sameg14
sameg14 / partition_table.sql
Last active May 29, 2016 15:08
partition a mysql table by range. In this example we break the table into two partitions, one that contains all category_id < 5 and the other that contains everything else as indicated by maxvalue. Note that this will not work with tables that contain an auto incrementing primary key
/** This table cannot include an auto incrementing numeric primary key **/
alter table users partition by range(category_id)(partition p5 values less than (5), partition pn values less than maxvalue);
@sameg14
sameg14 / restream_api_test.py
Created May 8, 2016 20:46
Example class to authenticate via the ReStream REST API using OAuth2 and sending a sample payload
import urllib
import urllib2
import json
import shelve
import random
from time import gmtime, strftime
from pprint import pprint
from datetime import datetime
@sameg14
sameg14 / JobScheduler.php
Created April 29, 2016 20:14
Schedule jobs
<?php
namespace Tib\CoreBundle\Job\Scheduler;
use \Resque;
use \Resque_Worker;
use \Resque_Job_Status;
use Tib\CoreBundle\Job\Data\Broker as DataBroker;
use Symfony\Component\DependencyInjection\ContainerInterface;
<?php
namespace Tib\CoreBundle\Service;
use Tib\CoreBundle\Db\DBCommon;
use Tib\CoreBundle\Model\Mix;
use Tib\CoreBundle\Model\User;
use Tib\CoreBundle\Model\MixComment;
@sameg14
sameg14 / S3Service.php
Created April 29, 2016 20:03
An example service that contains business logic
<?php
namespace Tib\CoreBundle\Service;
use Aws\S3\S3Client;
use Tib\CoreBundle\Model\User;
use Aws\S3\Iterator\ListObjectsIterator;
use Tib\CoreBundle\Exception\UploadException;
use Aws\Common\Credentials\CredentialsInterface;
use Tib\CoreBundle\Exception\InvalidDataException;