Skip to content

Instantly share code, notes, and snippets.

View pietrorea's full-sized avatar
✌️

Pietro Rea pietrorea

✌️
View GitHub Profile
@henhan
henhan / nginx_documentation.md
Last active April 15, 2024 02:31
Extend and override nginx config for Elastic Beanstalk Amazon Linux 2

Extend and override nginx config for Elastic Beanstalk Amazon Linux 2

Documentation on how to override or extend the default nginx config on Elastic Beanstalk running om Amazon Linux 2. Correct as of 2021-08-01. Also see the general documentation on how to extend linux servers.

All references to placing files refer to putting a file at this location in your application bundle. You should never modify a file directly at your Elastic Beanstalk server by ssh:ing to the server, since such a change will be wiped whenever your servers autoscale or if you rebuild your application completely.

Adding a new location block

The easiest extension is to add a new location block to the main server block. This can be done by placing a .conf file with a server block in the folder .platform/nginx/conf.d/elasticbeanstalk. Any such file is automatically included in the main server block.

Overriding the default location

@MichaelCurrin
MichaelCurrin / README.md
Last active March 5, 2024 22:06
GitHub GraphQL - Get files in a repository

Get GitHub Files

Get the metadata and content of all files in a given GitHub repo using the GraphQL API

You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.

The approach here is to query data from GitHub using the Github V4 GraphQL API.

About the query

@kennydee
kennydee / Fastfile
Last active September 23, 2018 18:49
Fastfile for staging environment with Appetize.io on React Native (iOs & Android), with statuses update on Github Enterprise
require 'httparty'
fastlane_version "1.95.0"
default_platform :ios
before_all do
# put here your token and iOs scheme app
ENV["GITHUB_TOKEN"] = "---"
ENV["APPETIZE_TOKEN"] = "---"
ENV["APP_IOS_SCHEME"] = "---"
@patricklynch
patricklynch / gist:689525d466c4ada42b8e
Last active October 30, 2021 05:23
The 6 ways to unwrap optionals in Swift 2.0
// The 6 ways to uwnrap optionals in Swift 2.0
//
// Created by Patrick Lynch on 6/28/15.
// Copyright © 2015 Patrick Lynch. All rights reserved.
import Foundation
// 1. Force Unwrapping
// 2. Optional Binding
// 3. Optional Chaining
@quellish
quellish / xcci.md
Created October 28, 2014 03:03
Xcode CI script variables

Variable

Type

@timsutton
timsutton / set_default_color_profile.py
Last active April 29, 2021 14:28
Very basic example to set a display device's default colorsync profile.
#!/usr/bin/python
import objc
import Foundation
import Quartz
# replace with url-encoded path to an icc profile
URL_ENCODED_ICC_PATH = 'file:///Library/Application%20Support/Adobe/Color/Profiles/SMPTE-C.icc'
# stripped bridge metadata of all we need for this sample:
@jimothyGator
jimothyGator / README.md
Last active March 21, 2024 10:08
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@revolunet
revolunet / landing-pages.md
Last active February 28, 2018 05:01
Beautiful SAAS landing pages
@Mins
Mins / mysql_secure.sh
Last active February 16, 2024 00:03
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@evadne
evadne / gist:4544569
Last active August 14, 2023 05:04
Todd Laney’s enhancements to Sticky Headers + UICollectionViewFlowLayout
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//