Skip to content

Instantly share code, notes, and snippets.

View ben-p-commits's full-sized avatar
:bowtie:

Ben P. ben-p-commits

:bowtie:
View GitHub Profile
@xero
xero / git-pretty-options.txt
Created October 1, 2012 19:59
git pretty format options
git pretty format options
-------------------------
- '%x20': space
- '%H': commit hash
- '%h': abbreviated commit hash
- '%T': tree hash
- '%t': abbreviated tree hash
- '%P': parent hashes
- '%p': abbreviated parent hashes
- '%an': author name
@polqf
polqf / SourceKitFix.rb
Last active August 26, 2021 16:42
SourceKit Fix
#
# This fix should solve most of the problems with SourceKit (Not only with Swift, also with Obj-C). Such as:
# - Not having autocompletion
# - False errors
#
# This is just a temporal fix. The problem could eventually return.
# If that happens, just re-run this file
#
# The implementation comes from an answer in stackoverflow, which helped me a lot.
#
@olih
olih / jq-cheetsheet.md
Last active July 16, 2024 23:02
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@ben-p-commits
ben-p-commits / ci_tag.zsh
Last active May 5, 2021 15:29
CI tagging script
#color utilities
Y="\033[1;33m"
R="\033[0;31m"
G="\033[0;32m"
B="\033[0;34m"
NC="\033[0m"
# handy functions
usage() { echo "Usage: ci_tag [-t <tf1|tf2|release>] [-m <release note>]" 1>&2;}
@ben-p-commits
ben-p-commits / desktop-cleanup.zsh
Created December 9, 2016 15:58
Clean up typical desktop cruft
#clean up cruft on the desktop.
Y="\033[1;33m"
R="\033[0;31m"
G="\033[0;32m"
B="\033[0;34m"
NC="\033[0m"
echo "${G}Cleaning up image cruft:${R}"
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active July 16, 2024 06:58
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@dmsl1805
dmsl1805 / SnakeCase.swift
Last active September 3, 2023 16:11 — forked from ivanbruel/SnakeCase.swift
Camel case to snake case in Swift
extension String {
func snakeCased() -> String? {
let pattern = "([a-z0-9])([A-Z])"
let regex = try? NSRegularExpression(pattern: pattern, options: [])
let range = NSRange(location: 0, length: count)
return regex?.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2").lowercased()
}
}