Skip to content

Instantly share code, notes, and snippets.

@jgardezi
jgardezi / stack.yaml
Created February 21, 2022 04:30 — forked from asishrs/stack.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS API Gateway with a Lambda Integration
Parameters:
lambdaFunctionName:
Type: "String"
AllowedPattern: "^[a-zA-Z0-9]+[a-zA-Z0-9-]+[a-zA-Z0-9]+$"
Description: Lambda function name. (Recommend to keep default)
Default: "lambda-api"
@jgardezi
jgardezi / Dockerfile
Last active July 20, 2018 04:19
ci-container
# Use an official Nodejs runtime as a parent image
FROM node:8.11.3
MAINTAINER Javed Gardezi <[email protected]>
RUN apt-get update && \
apt-get install -y python-dev python-pip
RUN pip install --upgrade pip
RUN pip install --upgrade awscli
@jgardezi
jgardezi / bitbucket-pipelines.yml
Created May 11, 2018 07:07 — forked from tstrohmeier/bitbucket-pipelines.yml
AWS ECS: Script for creating a new revision of a task definition and update a service
# enable Docker for your repository
options:
docker: true
pipelines:
branches:
development:
- step:
# python image with aws-cli installed
@jgardezi
jgardezi / remote react bootstrap table example
Created January 28, 2018 22:28 — forked from xabikos/remote react bootstrap table example
An example of a react bootstrap table that fetches the data asynchronously when navigating between pages and when changing the page size
import React, {Component} from 'react';
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
import _ from 'lodash';
const dataTable = _.range(1, 60).map(x => ({id: x, name: `Name ${x}`, surname: `Surname ${x}`}));
// Simulates the call to the server to get the data
const fakeDataFetcher = {
fetch(page, size) {
return new Promise((resolve, reject) => {
@jgardezi
jgardezi / BaseModel.php
Created August 31, 2017 00:53 — forked from JeffreyWay/BaseModel.php
To make for clean and readable tests, do your mocking in a base model that your Eloquent models extend.
<?php
class BaseModel extends Eloquent {
public static function shouldReceive()
{
$repo = get_called_class() . 'RepositoryInterface';
$mock = Mockery::mock($repo);
App::instance($repo, $mock);