Skip to content

Instantly share code, notes, and snippets.

View viktorbenei's full-sized avatar

Viktor Benei viktorbenei

  • Bitrise Ltd (CTO & Cofounder)
  • Hungary
View GitHub Profile
@nacho4d
nacho4d / Daemon in OSX Example
Created April 8, 2012 17:06
Daemon in OSX Example
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
# pragma mark Daemon Protocol
@protocol DaemonProtocol
- (void)performWork;
@end
# pragma mark MyTask Object Conforms to Protocol
@viktorbenei
viktorbenei / install-bitrise-cli.sh
Last active July 13, 2019 22:16
install-bitrise-cli.sh
#!/usr/bin/env bash
set -e
function main {
bitrise_cli_ver="$1"
if [ -z "${bitrise_cli_ver}" ] ; then
echo " [!] No version specified, required! Run this script as: $ bash install-bitrise-cli.sh x.x.x"
exit 1
fi
echo "Installing Bitrise CLI v${bitrise_cli_ver} ..."
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@MattNewberry
MattNewberry / bluepill.sh
Created February 8, 2017 17:12
Bluepill step
#!/bin/bash
set -ex
#install bluepill
git clone git@github.com:linkedin/bluepill.git "$BITRISE_SOURCE_DIR/bluepill"
#build bluepill
cd "$BITRISE_SOURCE_DIR/bluepill"
./scripts/bluepill.sh build
@viktorbenei
viktorbenei / gist:cca967e09bf701aa9cb5
Last active March 19, 2018 09:39
Bash script to generate secure passwords
#
# requires 'pwgen', can be installed with brew
#
# add this to your .bash_profile, .profile or .bashrc for quick terminal access
# input: the length of the password
# usage example: gensecpsw 16
# example result: XjQ%uWQ.&7-T4@`(
#
gensecpsw() {
printf '%s' $(pwgen -B -c -s -n -y $1 1) |pbcopy; echo "Has been copied to clipboard"
@viktorbenei
viktorbenei / gist:11367575
Created April 28, 2014 10:10
Auto increment build number of Xcode project
#
# Paste this into a new "Run Script" Build Phase (as described here: http://stackoverflow.com/a/15483906/974381)
#
# Tip: drag-and-drop your new Run Script to run before the "Compile Sources" Phase!
#
# Source: http://stackoverflow.com/a/15483906/974381
#
# How to get version numbers in code?
# NSString *buildString = infoDictionary[(NSString*)kCFBundleVersionKey];
# NSString *versionString = infoDictionary[@"CFBundleShortVersionString"];
@fadookie
fadookie / bash_list_library.sh
Last active August 2, 2017 21:55
Example of bash array to pipe-delimited string de/serialization, for discussion at https://discuss.bitrise.io/t/output-from-multiple-instances-of-the-same-step/538
# WARNING! The following is not as safe as I originally thought and I'm not sure yet the right way to do this.
# See https://unix.stackexchange.com/questions/383541/how-to-save-restore-all-shell-options-including-errexit
enable_safety() {
BITRISE_CLI_PREVIOUS_SHELL_OPTIONS=$(set +o)
set -o nounset
set -o errexit
set -o pipefail
}
@viktorbenei
viktorbenei / add_launchd_to_tcc.sh
Last active August 29, 2015 14:27 — forked from mtauraso/add_launchd_to_tcc.sh
TCC Database Script
#!/bin/bash
# This will add lauchd to the list of allowed processes for accessibility access
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/sbin/osascript',1,1,1,NULL)"
# This outputs the rows in the TCC database
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db 'select * from access'
echo "Restart is required for these changes to take effect"