Skip to content

Instantly share code, notes, and snippets.

View alphatroya's full-sized avatar

Alexey Korolev alphatroya

  • Heads and Hands
View GitHub Profile
@joshdholtz
joshdholtz / Fastfile
Created July 31, 2021 15:13
Fastfile - build, manage provisioning and version/build numbers, and upload to App Store Connect
lane :build_and_upload do
# Build by allowing provisioning updates, auto version and build number management,
# and uploading directly to App Store Connect
#
# Requires: signed in with Apple ID in Xcode
# Radar for using App Store Connect API Key: FB9145847
gym(
xcargs: "-allowProvisioningUpdates",
export_options: {
"destination": "upload",
@druckdev
druckdev / refactor.md
Last active September 28, 2021 09:59
Refactoring from camelCase to snake_case (functions, variables & files)

For a project that sadly will not be made public (See PR) I had to rename some components. This is of course a very specific solution targeted only to our project but maybe it can help/give a starting point for a similar problem. Here is the documentation from the pull request:

Pull request

Trying to rename components to use the snake case naming. (See PEP 8)

I am not happy with the result that the full fledged IDE pycharm brings. (I also just dislike those super heavy programs) Since some of the variable names are used in strings to access fields in the jsons I cannot simply rename every occurrence. Pycharm gives the option to exclude matches in strings etc, but I still would have to do it for every component.

@ethanhuang13
ethanhuang13 / FacebookAuth.swift
Last active October 3, 2024 12:26
FacebookAuth is for iOS app developers who need to support Facebook login but don't want to use the official SDK
//
// FacebookAuth.swift
// GitHub: ethanhuang13
// Twitter: @ethanhuang13
import AuthenticationServices
import SafariServices
/*
Updated:
@fnky
fnky / ANSI.md
Last active November 16, 2024 01:32
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@pepasflo
pepasflo / .gitignore
Last active October 22, 2023 12:06
Scripts for encrypting / decrypting secrets (to prevent them from being accidentally checked into git)
secrets/
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@mihow
mihow / load_dotenv.sh
Last active October 22, 2024 08:26
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 13, 2024 22:21
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@donpark
donpark / gist:7549a1a2a5f7eef7fbea
Created January 11, 2015 06:53
CALayer with resizable image
- (CALayer*)layerFromResiableImage:(UIImage*)image {
CGSize size = [image size];
UIEdgeInsets insets = [image capInsets];
CALayer *layer = [CALayer layer];
[layer setContents:(id)[image CGImage]];
layer.contentsCenter = CGRectMake(insets.left / size.width, insets.top / size.height,
1.0/size.width, 1.0 / size.height);
return layer;
}
@jmazzi
jmazzi / lastpass_to_keepassx.rb
Created June 13, 2010 19:57
Convert LastPass CSV to KeePassX XML
#!/usr/bin/ruby
#
# I recommend using Pocket to do the export. It works better than the browser extensions.
require 'rubygems'
require 'htmlentities'
require 'csv'
# CHANGE THIS
input_file = '/path/to/passwords.csv'