Skip to content

Instantly share code, notes, and snippets.

@kocoai
kocoai / adb.sh
Created December 6, 2019 16:34
Set up adb on Mac OS X #android
# https://stackoverflow.com/questions/17901692/set-up-adb-on-mac-os-x
brew cask install android-platform-tools
@kocoai
kocoai / replacetexts.regexp
Last active July 23, 2019 13:46
replace texts in quote #regexp
"(?:[^"\\]|\\.)*"
NSLocalizedString($0, comment: "")
@kocoai
kocoai / nativefier.sh
Last active November 27, 2019 22:09
#nativefier
nativefier -n SoundCloud --disable-dev-tools --single-instance -i ~/Desktop/soundcloud.icns https://soundcloud.com/stream
@kocoai
kocoai / update.sh
Last active July 11, 2019 12:04
update raspberry #pi ipv4
apt-get -o Acquire::ForceIPv4=true update
apt-get -o Acquire::ForceIPv4=true -y dist-upgrade
@kocoai
kocoai / trad.swift
Last active July 11, 2019 12:00
template NSLocalizedString #swiftgen #swift
extension L10n {
fileprivate static func tr(_ key: String, _ args: CVarArg...) -> String {
// Load from App's Bundle first
let format: String = NSLocalizedString(
key,
bundle: Bundle.main,
value: NSLocalizedString(key, bundle: Bundle(for: SportStringsBundleToken.self), value: "", comment: ""),
comment: ""
)
return String(format: format, locale: Locale.current, arguments: args)
@kocoai
kocoai / findspaceanddashed.regexp
Created July 5, 2017 09:04
atom search space and dashed #regexp
\s-\s|\s
@kocoai
kocoai / betclic.sh
Last active July 11, 2019 12:54
run #ios app from #deeplink
xcrun simctl openurl booted betclicsportsfr://register
@kocoai
kocoai / Bash-les-paramettres.md
Last active July 11, 2019 12:26
Bash - les paramettres #shell

Les paramètres spéciaux Ce sont en fait là aussi des variables réservées qui permettent pour certaines d'effectuer des traitements sur les paramètres eux-même. Ces paramètres sont les suivants :

$0 Contient le nom du script tel qu'il a été invoqué

$* L'ensembles des paramètres sous la forme d'un seul argument

$@ L'ensemble des arguments, un argument par paramètre

$# Le nombre de paramètres passés au script

@kocoai
kocoai / HowcanIrecoveralostcommitinGit.md
Last active July 11, 2019 11:56
How can I recover a lost commit in #git?
@kocoai
kocoai / Pass_arguments_into_a_function.md
Last active July 11, 2019 12:26
Pass arguments into a shell function #shell

https://bash.cyberciti.biz/guide/Pass_arguments_into_a_function

  • All function parameters or arguments can be accessed via $1, $2, $3,..., $N.
  • $0 always point to the shell script name.
  • $* or $@ holds all parameters or arguments passed to the function.
  • $# holds the number of positional parameters passed to the function.