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 /
Last active May 17, 2023 00:57
Merge java source to single file
# can simply execute `python3` from the root of your project, if given the following folder structure:
# /project
# discussion.txt
# header.txt
# output.txt
# src/*.java
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 This is very useful for pulling a copy of an Azure-hosted SQL Server database
REM to your local instance for development purposes.
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 /
Created May 23, 2016 05:53 — forked from jrschumacher/
Ionic Automated Build and Deploy to HockeyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
charlesbedrosian /
Last active August 29, 2015 14:11
push build to testflight. This is based on the codebase at but greatly reduced and refocused for automated use.
if [[ "$WORKSPACE" == "" ]]; then
#specify these configuration values
charlesbedrosian /
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.
function set_default_value_for_key {
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 /
Last active August 29, 2015 14:11
Utility to scan a settings plist and remove a entries matching a key from the provided list.
if [ $# -ne 2 ]; then
echo "Invalid parameters specified."
echo "expected syntax to remove keys in list from plist file some.plist:"
echo "./ some.plist key1,key2,key3"i
exit 1
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)
my convertGraffles()
charlesbedrosian /
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_count=`git log --oneline | wc -l | tr -d ' '`
#where are we getting the original data from?
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"