Skip to content

Instantly share code, notes, and snippets.

jalakoo

Block or report user

Report or block jalakoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jalakoo
jalakoo / ubuntu+aai.sh
Last active Oct 16, 2019
Ubuntu + alwaysAI supporting setup
View ubuntu+aai.sh
#!/bin/bash
# In ubuntu / ubuntu VM
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get update && sudo apt-get install nodejs -y
sudo apt-get install npm -y
sudo apt-get remove docker docker-engine docker.io -y
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@jalakoo
jalakoo / hot-reload.sh
Last active Oct 4, 2019
Simple nodemon script that allows for deploy & start upon file save.
View hot-reload.sh
#!/bin/bash
# To make this file executable from the command line, enter: `chmod +x hot-reload.sh`
nodemon -x "./reload.sh" --ext py
@jalakoo
jalakoo / reload.sh
Last active Oct 4, 2019
Simple alwaysAI redploy script
View reload.sh
#!/bin/bash
# To make this file executable from the command line, enter: `chmod +x reload.sh`
aai app exec sudo killall python -9 --no-container
aai app deploy --yes
aai app start
@jalakoo
jalakoo / String+Localization.swift
Last active Aug 31, 2018
Simple localization category for Swift strings
View String+Localization.swift
import Foundation
extension String {
// Example usage: "My Text".localized()
func localized() -> String {
return Bundle.main.localizedString(forKey: self,
value: nil,
table: nil)
}
@jalakoo
jalakoo / UIView+Fades.swift
Created Jul 6, 2018
Swift UIView simple fading extensions
View UIView+Fades.swift
extension UIView {
func reveal() {
if self.alpha == 1.0 {
return
}
UIView.animate(withDuration: 0.5) {
self.alpha = 1.0
self.isUserInteractionEnabled = true
}
}
@jalakoo
jalakoo / QRManager.swift
Last active Jul 6, 2018
Manager Class for handling QR Scanning
View QRManager.swift
// Requirements: info.plist: 'Privacy - Camera Usage Description'
import UIKit
import AVFoundation
import QRCodeReader //pod 'QRCodeReader.swift', '~> 8.2.0'
typealias QRManagerErrorBlock = (_ error: Error)->()
typealias QRManagerResultBlock = (_ valueScanned: String)->()
enum QRManagerError : Error {
@jalakoo
jalakoo / Git Aliases
Created Jun 2, 2018
Adding Git aliases globally
View Git Aliases
git config --global alias.st status
git config --global alias.br branch
git config --global alias.lo 'log --oneline --decorate=full'
@jalakoo
jalakoo / Xcode warnings run script
Last active Mar 7, 2018
Run script that will mark TODO/FIXME/WARNINGs as compiler warnings.
View Xcode warnings run script
// Add this to a new run script in a target:Build Phases tab
TAGS="TODO:|FIXME:|WARNING:"
echo "searching ${SRCROOT} for ${TAGS}"
find "${SRCROOT}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/"
View gist:1dc6d979bf2230021c4be983804ff6ee
# Add this to the bottom of existing or new `~/.bash_profile`
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@jalakoo
jalakoo / ios_symbolication_instructions.md
Last active Jan 3, 2018
iOS Symbolication Instructions
View ios_symbolication_instructions.md

iOS CRASH SYMBOLICATION INSTRUCTIONS

Not ideal, but works.

  1. Copy .app, .dSYM and .crash file into a temp folder
  2. Copy the relevant crash symbols into a txt file name 'symbols.txt'. Format should look like:
0x00110176 0xb8000
0x0011003a 0xb8000
0x001d2d44 0xb8000
You can’t perform that action at this time.