Skip to content

Instantly share code, notes, and snippets.

View charlesbedrosian's full-sized avatar

Charles Bedrosian charlesbedrosian

  • Chicago, IL USA
View GitHub Profile
@charlesbedrosian
charlesbedrosian / prepjava.py
Last active May 17, 2023 00:57
Merge java source to single file
#!/usr/bin/python3
#
# can simply execute `python3 prepjava.py` from the root of your project, if given the following folder structure:
# /project
# discussion.txt
# header.txt
# output.txt
# src/*.java
#
@charlesbedrosian
charlesbedrosian / RestoreFromAzure.bat
Created November 15, 2019 07:16
Copying data-tier applications between environments
@echo off
REM ***************************************************************************
REM To use:
REM provide your source and destination server configuration parameters.
REM It will append a date to the restored database catalog because the database
REM should not exist when restoring.
REM
REM This is very useful for pulling a copy of an Azure-hosted SQL Server database
REM to your local instance for development purposes.
REM
@charlesbedrosian
charlesbedrosian / 010_copy_build_extras.js
Last active March 19, 2020 11:01
Copy build-extras to platforms/android
#!/usr/bin/env node
//goes in hooks/after_platform_add/
var fs = require('fs');
rootdir = process.argv[2],
android_dir = rootdir + '/platforms/android';
gradle_file = rootdir + '/build-extras.gradle';
dest_gradle_file = android_dir + '/build-extras.gradle';
@charlesbedrosian
charlesbedrosian / build-and-deploy.sh
Created May 23, 2016 05:53 — forked from jrschumacher/build-and-deploy.sh
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
@charlesbedrosian
charlesbedrosian / testflight.sh
Last active August 29, 2015 14:11
push build to testflight. This is based on the codebase at https://gist.github.com/c0diq/2213571 but greatly reduced and refocused for automated use.
#!/bin/bash
if [[ "$WORKSPACE" == "" ]]; then
WORKSPACE=$(pwd)
fi
#specify these configuration values
TESTFLIGHT_API_TOKEN=""
TESTFLIGHT_TEAM_TOKEN=""
@charlesbedrosian
charlesbedrosian / update_settings_with_git.sh
Created December 19, 2014 05:36
Takes inforrmation from git repo and updates the settings bundle values for known keys. Also sets the version information based on the number of git commits as a means to increment the bundle version and appends it to the version string.
#/bin/bash
function set_default_value_for_key {
key_to_find=$1
value_to_set=$2
cnt=`/usr/libexec/PlistBuddy -c "Print PreferenceSpecifiers:" $plist | grep "Dict"|wc -l | tr -d ' '`
cnt=`expr "$cnt" '-' '1'`
for i in `seq 0 $cnt`; do
key=`/usr/libexec/PlistBuddy -c "Print PreferenceSpecifiers:${i}:Key" $plist 2>/dev/null`
if [[ $key == $key_to_find ]]; then
@charlesbedrosian
charlesbedrosian / remove_key.sh
Last active August 29, 2015 14:11
Utility to scan a settings plist and remove a entries matching a key from the provided list.
#/bin/bash
if [ $# -ne 2 ]; then
echo "Invalid parameters specified."
echo "expected syntax to remove keys in list from plist file some.plist:"
echo "./remove_key.sh some.plist key1,key2,key3"i
exit 1
fi
plist="$1"
keysToRemove="$2"
@charlesbedrosian
charlesbedrosian / batch export graffles
Last active December 16, 2015 16:40
This script prompts for a folder, then recursively generates PDFs of all graffles found, using the name of the graffle and saving the PDF to the graffle's same folder.
property kGraffleAliasList : {}
tell application "Finder"
set source_folder to choose folder with prompt "Please select directory."
my createList(source_folder)
kGraffleAliasList
my convertGraffles()
@charlesbedrosian
charlesbedrosian / build.sh
Created March 9, 2013 22:03
XCode post build script to setup settings with current build information, different for Debug and Release versions
#get commit stats (date and SHA)
commit_sha=`git rev-parse --short HEAD`
commit_ts=`git show -s --format="%ci" $sha`
commit_dt=${commit_ts:0:16}
commit_count=`git log --oneline | wc -l | tr -d ' '`
SETTINGSBUNDLEPATH="$CODESIGNING_FOLDER_PATH/Settings.bundle/Root.plist"
#where are we getting the original data from?
@charlesbedrosian
charlesbedrosian / SQL Server Dump to CSV.vbs
Created March 3, 2013 19:57
vbscript/wsh script to dump all tables in the indicated SQL database to CSV files. Replaces CrLf with \r\n and replaces NULL values with <null> string
Option Explicit
Dim server_name, db_name
Dim cs, cn, rsTables, rsData, sql, rsCount
Dim line, fso
Dim outfile
Dim i
Dim lineCount, lineTotalCount, baseMessage
server_name = "win7b"
db_name = "io"