Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View timanrebel's full-sized avatar
💭
I may be slow to respond.

Timan Rebel timanrebel

💭
I may be slow to respond.
View GitHub Profile
Verifying that +timanrebel is my openname (Bitcoin username). https://onename.io/timanrebel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@timanrebel
timanrebel / svn-branches-git.sh
Last active September 14, 2015 17:43
SVN branches to Git branches on Mac OSX
git branch -r | grep -v tags | sed -Ene 's, *([^@]+)$,\1,p' | \
while read branch; \
do echo "git branch $branch $branch"; \
done | sh
@timanrebel
timanrebel / svn-tags-git.sh
Last active September 14, 2015 17:43
SVN tags to Git tags on Mac OSX
git branch -r | sed -Ene 's, *tags/([^@]+)$,\1,p' | \
while read tag; do \
echo "git tag $tag 'tags/${tag}^'; git branch -r -d tags/$tag"; \
done | sh
@timanrebel
timanrebel / gist:2359385
Created April 11, 2012 13:45
Simple Ti.UI wrapper
createAlertDialog: function(config) {
return Ti.UI.createAlertDialog(config);
},
createAnimation: function(config) {
return Ti.UI.createAnimation(config);
},
createButton: function(config) {
var args = arguments || {};
/**
* Works, but you loose change listeners on the original model
*/
$.user.set(args.user.attributes);
/**
* Does not work
*/
@timanrebel
timanrebel / index.js
Created June 5, 2013 16:03
Did you know it is possible to create custom XML tags in Alloy and use them?
// <<MyElement> becomes Ti.UI.createMyElement, so that doesn't work
Ti.UI.createMyElement({
id: 'myId'
});
// But give it a namespace and all of a sudden, it is translated to:
Sc.UI.createMySecondElement({
id: 'mySecondId'
})
@timanrebel
timanrebel / index.xml
Created June 24, 2013 09:37
We use one codebase for our iOS and Android app and like to reuse as much code as possible. It is not possible however to use a Widget inside a <Menu> tag, but you can inside a <RightNavButton>. It would really simplify our lives if we could use Widgets and generalize our MenuBar buttons across platforms. I do get the following error however: [E…
<Alloy>
<Window>
<RightNavButton>
<Widget src="sc.MenuBarButton" title="Save" onClick="onSave" />
</RightNavButton>
<Menu>
<Widget src="sc.MenuBarButton" title="Save" onClick="onSave" />
</Menu>
</Window>
@timanrebel
timanrebel / gist:7596146
Created November 22, 2013 07:23
Doing reverse Oauth with Ti.Social
// First do reverse Auth call
var Social = require('dk.napp.social');
var oauthString = '';
var jsOAuth = require('jsOAuth').OAuth;
var oauth = jsOAuth({
consumerKey: 'xxx',
consumerSecret: 'yyy'
});
oauth.request({
@timanrebel
timanrebel / gist:8505205
Created January 19, 2014 13:45
Platform and Density dependant images in Alloy widgets
app/widgets/sc.MenuBarButton/assets/android/images/res-xhpdi/like.png
becomes
Resources/android/android/images/res-xhdpi/sc.MenuBarButton/like.png
but is not displaying with
WPATH('/images/like.png')