Skip to content

Instantly share code, notes, and snippets.

@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@candostdagdeviren
candostdagdeviren / pre-commit
Last active April 22, 2023 09:32
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
@candostdagdeviren
candostdagdeviren / Dangerfile
Last active February 1, 2023 10:40
Sample Dangerfile for iOS Project
# PR is a work in progress and shouldn't be merged yet
warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]"
# Warn when there is a big PR
warn "Big PR, consider splitting into smaller" if git.lines_of_code > 500
# Ensure a clean commits history
if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ }
fail "Please rebase to get rid of the merge commits in this PR"
end
@shakefu
shakefu / example.sh
Last active August 30, 2022 01:22
Bash Script with Short and Long Options
# Option defaults
OPT="value"
# getopts string
# This string needs to be updated with the single character options (e.g. -f)
opts="fvo:"
# Gets the command name without path
cmd(){ echo `basename $0`; }
#!/bin/bash
set -e
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${THIS_SCRIPT_DIR}/.."
# Check if there's something uncommitted (don't release if there are files
# not yet committed)
set +e
@kreeger
kreeger / pod-install-post-checkout
Last active November 30, 2021 08:15
A post-checkout hook for running a pod install after a git checkout event.
#!/bin/sh
if [ $1 = 0000000000000000000000000000000000000000 ]; then
old=4b825dc642cb6eb9a060e54bf8d69288fbee4904
else
old=$1
fi
if [ -f Podfile ] && command -v pod install >/dev/null &&
git diff --name-only $old $2 | egrep -q '^Podfile$'
then
(unset GIT_DIR; exec pod install) | grep -v '^Using ' | grep -v ' is complete'
@harmittaa
harmittaa / .travis.yml
Last active November 22, 2020 05:38
Example .travis.yml file for Android
# Tutorial here: https://medium.com/@harmittaa/travis-ci-android-example-357f6e632fc4
language: android
sudo: required
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
@kristopherjohnson
kristopherjohnson / .clang-format
Last active February 18, 2020 13:51
Script that runs clang-format on files in a set of directories
BasedOnStyle: Webkit
BreakBeforeBraces: Allman
BreakConstructorInitializersBeforeComma: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
IndentCaseLabels: true
MaxEmptyLinesToKeep: 2
PointerBindsToType: false
SpacesBeforeTrailingComments: 2
Standard: Cpp11
machine:
environment:
TERM: "dumb"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx5120m -XX:+HeapDumpOnOutOfMemoryError"'
ANDROID_HOME: /usr/local/android-sdk-linux
java:
version:
oraclejdk8
dependencies:
pre: