Skip to content

Instantly share code, notes, and snippets.

View vaskaloidis's full-sized avatar

Vas Kaloidis vaskaloidis

View GitHub Profile
import UIKit
import PlaygroundSupport
struct StringConstants {
static let bullet1 = "This is a small string."
static let bullet2 = "This is more of medium string with a few more words etc."
static let bullet3 = "Well this is certainly a longer string, with many more words than either of the previuos two strings."
}
typealias ParagraphData = (bullet: String, paragraph: String)
extension UIViewController {
func configureNavigationBar(largeTitleColor: UIColor, backgoundColor: UIColor, tintColor: UIColor, title: String, preferredLargeTitle: Bool) {
if #available(iOS 13.0, *) {
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: largeTitleColor]
navBarAppearance.titleTextAttributes = [.foregroundColor: largeTitleColor]
navBarAppearance.backgroundColor = backgoundColor
navigationController?.navigationBar.standardAppearance = navBarAppearance
if Rails.env.development? || Rails.env.test?
puts 'Deleting Line Items, Orders and Products'
LineItem.delete_all
Order.delete_all
Product.delete_all
else
puts 'NOT DELETING LINE-ITEMS, ORDERS, and PRODUCTS'
end
@vaskaloidis
vaskaloidis / duplicate_line_xcode.md
Created January 13, 2021 18:55 — forked from emotality/duplicate_line_xcode.md
Xcode - Duplicate Line key binding

Xcode line duplicate

Bind keys to duplicate lines in Xcode

  1. Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
if Rails.const_defined? 'Server'
options = { addr: ENV.fetch('PORT') { 3000 } }
puts 'Starting Ngrok'
Ngrok::Tunnel.start(options)
puts '[NGROK] tunneling at ' + Ngrok::Tunnel.ngrok_url_https
config.hosts << Ngrok::Tunnel.ngrok_url_https
ENV['api_return_url_base'] = Ngrok::Tunnel.ngrok_url_https
puts "[Ngrok] ENV VARIABLE api_return_url_base: #{ENV["api_return_url_base"]}"
@vaskaloidis
vaskaloidis / awk_reference.sh
Last active April 15, 2020 03:04 — forked from Rafe/gist:3102414
AWK cheatsheet
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
USAGE:
Unix: awk '/pattern/ {print "$1"}' # standard Unix shells
DOS/Win: awk '/pattern/ {print "$1"}' # compiled with DJGPP, Cygwin
awk "/pattern/ {print \"$1\"}" # GnuWin32, UnxUtils, Mingw
# FILE SPACING:

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).

<script>
window.onload = function() {
var target = document.getElementById('revealthis');
if( $('#yourtarget').is(':empty') ) {
target.style.display = 'block';
} else {
target.style.display = 'none';
}
#!/bin/sh
for file in *_h.png
do
mv "$file" "${file}/_h.png/_half.png"
done

Installed Apps

task