Skip to content

Instantly share code, notes, and snippets.

View AvinashDalvi89's full-sized avatar
🏠
Working from home

Avinash Dalvi AvinashDalvi89

🏠
Working from home
View GitHub Profile
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active July 6, 2024 22:51
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@yorkxin
yorkxin / README.md
Last active October 27, 2020 12:17
Amazon S3 Redirect Rules Generator

Amazon S3 Redirect Rules Generator

A Ruby script to generate simple Amazon S3 Redirection Rules XML file.

Update: There is an app for that now! Use Amazon S3 Redirector (Web app) and you can generate the XML without any knowledge about Ruby. Thanks to @rainforestapp. BTW, It's open source too.

Dependencies

  • Nokogiri
@idleberg
idleberg / Install-Mcrypt.md
Last active May 31, 2023 17:13
Install Mcrypt on macOS

Setup php-mcrypt on macOS (and versions of Mac OS X)

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew and PECL (comes with PHP)

# PHP 7.3
@mandiwise
mandiwise / Count lines in Git repo
Last active July 4, 2024 16:56
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active July 2, 2024 09:21
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@jeffsrepoaccount
jeffsrepoaccount / post-merge
Last active June 30, 2023 09:42
Git post merge hook for auto-tagging release/hotfix branches based off of branch name
#!/usr/bin/env bash
###############################################################################
#
# Automatically detects a merge on to master from a gitflow-style release
# branch, e.g. release-1.1.1-alpha. If the merged branch matches, the major,
# minor and patch versions are determined and a new release tag is created
# locally. If remote origin exists, this tag will automatically be pushed.
#
# In addition to creating a tag, the release branch will automatically be
# merged into the develop branch. If the branch has already been merged this
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
- "pypy3"

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag an image into the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.

#!/bin/sh
# This script will be executed after commit in placed in .git/hooks/post-commit
# Semantic Versioning 2.0.0 guideline
#
# Given a version number MAJOR.MINOR.PATCH, increment the:
# MAJOR version when you make incompatible API changes,
# MINOR version when you add functionality in a backwards-compatible manner, and
# PATCH version when you make backwards-compatible bug fixes.
@alexdebrie
alexdebrie / README.md
Created February 1, 2019 01:59
Using boto3 generate_presigned_post()

Using an S3 presigned POST url.

  1. Copy the generate.py script to your machine.

  2. Update the BUCKET_NAME and KEY_NAME values in the script as needed.

  3. Run python generate.py. It will spit some output like the following:

$ python3 generate.py