Skip to content

Instantly share code, notes, and snippets.

@dombarnes
dombarnes / Dockerfile
Created January 1, 2024 23:04
My current Rails/Docker/Azure CI pipeline
FROM ruby:3.2.2-alpine3.18 as dependencies
ARG RAILS_ENV=production
ARG RAILS_LOG_TO_STDOUT=true
ARG RAILS_SERVE_STATIC_FILES=true
ARG RAILS_MASTER_KEY=''
ARG OAUTH_CLIENT_ID=''
ARG OAUTH_CLIENT_SECRET=''
ARG OAUTH_SERVER=''
ARG PORT=3000
@dombarnes
dombarnes / DarkModeToggle.vue
Created September 12, 2023 00:14
Dark Mode Toggle Vue 3 Component with System-based Option
<template>
<div class="flex flex-col">
<div class="flex items-center">
<label class="switch">
<input ref="darkModeToggle" type="checkbox" name="dark-mode" v-model="darkMode" @change="toggleMode" :disabled="useSystemSetting">
<span class="slider round"></span>
</label>
<label>Dark Mode</label>
</div>
<label class="m-1">
@dombarnes
dombarnes / BuildIPAForTestFlight.yml
Created June 22, 2023 21:49
Azure Devops YAML Pipeline for Xcode build and delivery to Testflight
parameters:
- name: "platforms"
type: object
default: {}
jobs:
- ${{ each platform in parameters.platforms }}:
- job: BuildIPAForTestFlight_${{platform}}
steps:
- task: DownloadSecureFile@1
@dombarnes
dombarnes / azure-pipelines.yml
Created April 6, 2023 20:14
Azure DevOps Pipeline for deploying NuxtJS 3 to Azure Static Web Apps
# Node.js with Vue
# Build a Node.js project that uses Vue.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
variables:
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
@dombarnes
dombarnes / build-stage.rb
Created December 7, 2015 22:10
Xcode Build Stage for incrementing build number based on git commits From http://blog.soff.es/automated-bundle-version
git = `sh /etc/profile; which git`.chomp
app_build = `#{git} rev-list --all | wc -l`.chomp.to_i
`/usr/libexec/PlistBuddy -c "Set :CFBundleVersion #{app_build}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"`
puts "Updated #{ENV['TARGET_BUILD_DIR']}/#{ENV['INFOPLIST_PATH']}"
@dombarnes
dombarnes / benderplus
Created November 24, 2015 11:31 — forked from anotherspot/benderplus
A modified script for robot clouds bender to include Mavericks Server backups of Service Databases
#!/bin/bash
# Bender
# Written by Chad Nielsen
# Forget Computers, Get Creative!
# Version History
# 1.0 - Initial creation of script for use with a companion launch daemon.
# 1.1 - Moved binary and log locations to /usr/local/robotcloud.
# 1.2 - Code improvements and added compatibility with OS X 10.9 Mavericks.
@dombarnes
dombarnes / AppName-Info.xml
Last active September 8, 2015 22:15
Xcode ATS Security for non-HTTPS domains
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>yourserver.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
@dombarnes
dombarnes / head.html
Created August 27, 2015 18:48
Safari 9 SVG Pinned Tab Icon (via @siracusa on ATP #132)
<link rel="icon" sizes="any" mask href="http://hypercritical.co/images/tiny-mac.svg" />
<link rel="mask-icon" mask href="http://hypercritical.co/images/tiny-mac.svg" color="black" />
scope :recent, -> { order('created_at DESC') }
scope :owned, -> { where('user_id = ?', 'current_user.id' ) }
scope :current_user_only, -> { where('user_id = ?', 'current_user.id') }
scope :pending_items, -> { where(:quote_status => 'Pending') }
scope :lost_items, -> { where(:quote_status => 'Lost')}
scope :won_items, -> { where(:quote_status => 'Won')}
@dombarnes
dombarnes / new_gist_file
Created March 12, 2015 14:34
iOS7/8 UIAlert
{
if (([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending)) {
// use UIAlertView
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Are you sure you want to do this on iOS7?" delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
[alert show];
}
else {
// use UIAlertController
UIAlertController *discardController = [UIAlertController
alertControllerWithTitle:@"Alert Title"