Skip to content

Instantly share code, notes, and snippets.

@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
@ziadoz
ziadoz / install.sh
Last active March 5, 2024 20:04
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`
@Tadas44
Tadas44 / circle.yml
Created December 6, 2016 14:25
CircleCi Android Configuration
dependencies:
pre:
# Android SDK Platform 24
- if [ ! -d "/usr/local/android-sdk-linux/platforms/android-24" ]; then echo y | android update sdk --no-ui --all --filter "android-24"; fi
# Android SDK Build-tools, revision 25.0.1
- if [ ! -d "/usr/local/android-sdk-linux/build-tools/25.0.1" ]; then echo y | android update sdk --no-ui --all --filter "build-tools-25.0.1"; fi
# Android Support Repository, revision 40 / Local Maven repository for Support Libraries
- if [ ! -d "/usr/local/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/25.0.1" ]; then echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"; fi
# Google Support Repository, revision 40 / Local Maven repository for Support Libraries
- if [ ! -d "/usr/local/android-sdk-linux/extras/google/m2repository/com/google/firebase/firebase-core/10.0.1" ]; then echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"; fi
@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/
machine:
environment:
TERM: "dumb"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx5120m -XX:+HeapDumpOnOutOfMemoryError"'
ANDROID_HOME: /usr/local/android-sdk-linux
java:
version:
oraclejdk8
dependencies:
pre:
@mohsenoid
mohsenoid / circle.yml
Last active June 22, 2017 18:14
circleci.com Android sample YML file
#
# Android build configuration for CircleCI.com
#
general:
artifacts:
- /home/ubuntu/your-app-name/app/build/outputs/apk/
machine:
environment:
@h0lyalg0rithm
h0lyalg0rithm / circle.yml
Created January 10, 2016 20:44
Android CircleCI Build config
#Install android build tools, platforms
#Supported versions here https://circleci.com/docs/android
dependencies:
override:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.1,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
#Pull any submodules
checkout:
post:
#!/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
@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