Skip to content

Instantly share code, notes, and snippets.

View adampax's full-sized avatar
🏠
Working from home

Adam Paxton adampax

🏠
Working from home
View GitHub Profile
@cr0ybot
cr0ybot / README.md
Last active February 10, 2020 20:57
Titanium IcoMoon Font Icons

Titanium IcoMoon Font Icons

IcoMoon is a fantastic service for putting together a lean collection of custom icons in a single font file for use on the web and, now in a Titanium app!

  1. On the IcoMoon Generate tab, make sure that the glyphs are named how you want to access them in the app. For instance, a gear icon might be named "settings".
  2. Generate and download your font files. Place you IcoMoon TTF font file and the selection.json file into app/assets/fonts.
  3. Place icon.js into your app/lib/ folder.
@Amzd
Amzd / UIKitTabView.swift
Last active September 29, 2024 12:32
UIKitTabView. SwiftUI tab bar view that respects navigation stacks when tabs are switched (unlike the TabView implementation)
/// An iOS style TabView that doesn't reset it's childrens navigation stacks when tabs are switched.
public struct UIKitTabView: View {
private var viewControllers: [UIHostingController<AnyView>]
private var selectedIndex: Binding<Int>?
@State private var fallbackSelectedIndex: Int = 0
public init(selectedIndex: Binding<Int>? = nil, @TabBuilder _ views: () -> [Tab]) {
self.viewControllers = views().map {
let host = UIHostingController(rootView: $0.view)
host.tabBarItem = $0.barItem
@camsjams
camsjams / guide.md
Last active May 1, 2022 16:21
How to upgrade a Node JS Express project using Swagger-Express

How to upgrade a Node JS Express project using Swagger

Migrate [swagger-express-mw] / and underlying [swagger-node-runner] to [express-openapi]

Intro

Why do this?

There have been a number of high and critical vulnerabilities caused by the npm package.

I myself have been hunting through ways to figure out how to solve these problems, as the package maintainers seem to have abandonded this library (there was even an NPM fork which still seems to have issues with bagpipes - see [swagger-node-runner year old PR]). I have created a basic guide to help others out, so that I am not just another DenverCoder9 (https://xkcd.com/979/)

[npm audit] and [snyk] scans find issues like:

@hansemannn
hansemannn / ti.dynamiclib.js
Last active July 10, 2017 15:49
Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop
/**
* Ti.DynamicLib
* @abstract Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop.
* @version 1.1.0
*
* Install:
* 1) Search and replace '../../src/<YourFramework>.framework' with your framework location.
The path is relative to the `build/iphone` directory.
* 2a) For classic modules:
* - Add 'LD_RUNPATH_SEARCH_PATHS=$(inherited) "@executable_path/Frameworks" $(FRAMEWORK_SEARCH_PATHS)'
@bubbobne
bubbobne / geometry_geojson.yaml
Last active November 2, 2023 19:08
A #swagger #geojson geometry description
#MIT License
#
#Copyright (c) 2017 Daniele Andreis
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
@falkolab
falkolab / fixmenu.js
Last active February 14, 2016 19:50
Fix for not displayed ActionBar menu in Titanium SDK
// Not rendered menu fix
// Author: Andrey Tkachenko, falkolab
// Source: https://gist.github.com/falkolab/29ab007f4981f1d747f2
exports.fix = function(win) {
if (win.activity) {
win.addEventListener('open', function fixMenu(evt) {
evt.source.removeEventListener(evt.type, fixMenu);
var activity = evt.source.activity;
if (activity.onCreateOptionsMenu) {
activity.onCreateOptionsMenu = _.partial(function(func, e) {
@grantges
grantges / charts.js
Last active November 13, 2017 18:17
Hyperloop Donut Example using Alloy Custom Tags (charts.js should be put in the app/lib folder of your app)
var Hyperloop = require('hyperloop');
var UIView = require('UIView');
var CGRect = require('CGRect');
var CGPoint = require('CGPoint');
var UIColor = require('UIColor');
var UIBezierPath = require('UIBezierPath');
function DEGREES_TO_RADIANS(angle) { return (Number(angle) / 180.0 * Math.PI) };
@Qwerios
Qwerios / gist:ae0bcd32dc1c5c871d06
Last active May 9, 2019 14:11
My Jenkins for Appcelerator mobile CI

Hardware & OS

Running on Apple Mac mini Dualcore i5 2.8GHz (MGEQ2FN/A) OSX Yosemite: 10.10.1

UPDATE Nov 3rd 2015: Upgraded to El Capitan caused my Jenkins to stop working. I had to apply the file permission fix for the log folder again (see known issues at the end of this gist). I also had to reinstall legacy java support and load the jenkins daemon again with launchctl. I took the time to update all the components mentioned in this gist when I did the upgrade. So the Android sdk/ndk, nodejs (0.10 -> 0.12), Titanium and Java. Beware that there is a new command-line tool for titanium (appc from the 'appcelerator' package).

User account setup

I installed and setup the new Mac with 1 main administrative account. In the scripts below it is assumed you are logged in as this administrative user. Changing to the jenkins user is done using sudo su - jenkins.

Required accounts

@viezel
viezel / build-module-android.sh
Last active August 29, 2015 14:01
Build and copy android module
##
## Build an Appcelerator Android Module
## Then copy it to the default module directory
##
## (c) Napp ApS
## Mads Møller
##
## HOW TO GUIDE
@jasonkneen
jasonkneen / index.js
Created May 15, 2014 14:45
Demonstrate CollapsableView Tag in Alloy.
function collapse(){
$.myView.collapse();
// $.myView.expand();
}