Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jason Kneen jasonkneen

🏠
Working from home
View GitHub Profile
@jasonkneen
jasonkneen / push-all-tags.sh
Created Nov 20, 2018 — forked from jamieoliver/push-all-tags.sh
Push all Git tags to a remote repository. Useful for keeping a fork up to date with the upstream repo.
View push-all-tags.sh
git push <remote> --tags
@jasonkneen
jasonkneen / gitconfig
Created Nov 16, 2018
Getting release notes from Git logs
View gitconfig
# drop this into your ./.gitconfig file
# usage
# $ git today
# $ git yesterday
# $ git since 18-11-01
#
# will display a list of formatted commits you can lift to use for release notes
[alias]
today = log --since=1am --pretty=format:"%C(blue)-\\ %s"
View genesis_public_key
0411162374b5fcbd0817ddc24470640dc281136483a34ae1a1600bb6918bac5696fdb48c57a04aaaaa0c29d1e4f41148421584d10cc51beac97aae017f359d6af9
@jasonkneen
jasonkneen / index.js
Created Jan 14, 2016 — forked from afranioce/index.js
Appcelerator swipe card like tinder
View index.js
var win = Titanium.UI.createWindow({
backgroundColor: "#ffffff",
title: "win"
});
// animations
var animateLeft = Ti.UI.createAnimation({
left: -520,
transform: Ti.UI.create2DMatrix({rotate: 60}),
opacity: 0,
@jasonkneen
jasonkneen / elements.js
Last active Nov 28, 2016
In the latest TiAlloy you can specify a module tag against the <Alloy> element in XML and this will be used when creating any elements in the view, so you can override, customise etc. The problem is if you want to use multiple commonJS libraries, there's no support in the Alloy Tag -- you'd have to change the module attribute for each element --…
View elements.js
var o = {};
// include the modules you want - purposely did this as seperate lines so it's easier to comment out modules etc
_.extend(o, require("module1"));
_.extend(o, require("module2"));
_.extend(o, require("module3"));
// make available under a single export for use in <Alloy> tag
module.exports = o;
View keybase.md

Keybase proof

I hereby claim:

  • I am jasonkneen on github.
  • I am jasonkneen (https://keybase.io/jasonkneen) on keybase.
  • I have a public key whose fingerprint is 6B43 0656 0B6A DD66 A98D DE12 6B6E 080E CD0C 5CFE

To claim this, I am signing this object:

@jasonkneen
jasonkneen / Alloy.js
Last active Nov 27, 2018
Dynamically change languages in a Titanium Alloy app (for testing)
View Alloy.js
// add this to the Alloy.js file
// Set to run in ENV_DEV mode so it's used for testing withou
// having to change languages on device etc
// NO checks in place so assumes you know what you're doing, have
// the relevant strings files and specify the correct one!
// should work on Android - not tested yet!
if (ENV_DEV) {
Alloy.Globals.setLanguage = function(lang) {
@jasonkneen
jasonkneen / index.xml
Last active Jul 11, 2020
Flipboard style tabgroup indicator for iOS. Drop tabIndicator.js into your Alloy lib folder, then add the module tag to your tabgroup and parameters to override the defaults. As you click on each tab, the indicator will slide across. VIDEO https://www.dropbox.com/s/cbw5e1ruksud9uo/tabindicator.mp4?dl=0
View index.xml
<!-- note the ONLY change to this is the additional module="tabIndicator"
attribute + properties to override indicator defaults //-->
<Alloy>
<TabGroup module="tabIndicator" tabsBackgroundColor="#000" tabIndicatorHeight="1" tabIndicatorColor="white" tabIndicatorWidth="75%">
<Tab title="Tab 1" icon="/images/icons/519-tools-1.png" activeIcon="/images/icons/519-tools-1_active.png" color="#555" activeColor="#fff">
<Window title="Tab 1" barColor="black" navTextColor = "#fff">
<Label onClick="openWin1">Tab 1</Label>
</Window>
</Tab>
<Tab title="Tab 2" icon="/images/icons/516-archive-box.png" activeIcon="/images/icons/516-archive-box_active.png" color="#555" activeColor="#fff">
@jasonkneen
jasonkneen / index.js
Last active Mar 15, 2017
Demo of how to use David Bankier's "Real Switch" for Android here. https://github.com/dbankier/RealSwitch. Add the Module to your TiApp.xml file, add a switch to your Alloy file as normal, but add the module attribute. Drop the ui.js file into your /lib/ folder (you can add to this) and then run the project. On iOS you'll get a regular iOS switc…
View index.js
$.mySwitch.addEventListener('change',function(e){
Ti.API.info('Switch value: ' + $.mySwitch.value);
});
@jasonkneen
jasonkneen / index.js
Created May 15, 2014
Demonstrate CollapsableView Tag in Alloy.
View index.js
function collapse(){
$.myView.collapse();
// $.myView.expand();
}