Skip to content

Instantly share code, notes, and snippets.

View stefanorg's full-sized avatar

Stefano stefanorg

View GitHub Profile
##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@Ocramius
Ocramius / application.config.php
Created July 26, 2013 14:39
Disabling BjyAuthorize when in console environment in a Zend Framework 2 Application
<?php
use Zend\Console\Console;
$config = array(
'modules' => array(
'Application',
'DoctrineModule',
'DoctrineORMModule',
// ...
@sheharyarn
sheharyarn / request.js
Last active August 24, 2023 14:55
Axios Request Wrapper for React (https://to.shyr.io/axios-requests)
/**
* Axios Request Wrapper
* ---------------------
*
* @author Sheharyar Naseer (@sheharyarn)
* @license MIT
*
*/
import axios from 'axios'
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active May 22, 2024 13:44
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@jlis
jlis / .gitlab-ci.yml
Created May 15, 2018 13:16
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
@giacomocerquone
giacomocerquone / api.js
Last active March 6, 2024 20:07
Handy thin wrapper around the fetch Api
const _toQueryString = params =>
`?${Object.entries(params)
.map(
([key, value]) =>
`${encodeURIComponent(key)}=${encodeURIComponent(value)}`
)
.join("&")}`;
// EDIT here if you prefer a storage implementation or a store subscription etc.
// you could actually also remove the getToken function and directly call it in the header below
@jewelsjacobs
jewelsjacobs / network-stack.ts
Created April 26, 2019 18:01
CDK VPC Subnets with CIDR Addresses
import cdk = require('@aws-cdk/cdk');
import ec2 = require('@aws-cdk/aws-ec2');
import { SubnetType } from '@aws-cdk/aws-ec2';
const region = 'us-east';
const azA = `${region}-1a`;
const azB = `${region}-1b`;
const azC = `${region}-1c`;
const availabilityZones = [azA, azB, azC];
const publicCidrs = ['10.1.192.0/24', '10.1.194.0/24', '10.1.196.0/24']