Skip to content

Instantly share code, notes, and snippets.

Timan Rebel timanrebel

Block or report user

Report or block timanrebel

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
@timanrebel
timanrebel / s3-invalidation.js
Created Apr 19, 2016 — forked from supinf/s3-invalidation.js
AWS Lambda script:: CloudFront Invalidations which are triggered by s3 events.
View s3-invalidation.js
console.log('Loading event');
var Q = require('q');
var aws = require('aws-sdk');
var cloudfront = new aws.CloudFront();
exports.handler = function (event, context) {
//_log('Received event: ', event);
var bucket = event.Records[0].s3.bucket.name;
@timanrebel
timanrebel / install.sh
Created Apr 10, 2016
Install pibus on OSMC
View install.sh
#!/bin/bash
HOMEDIR="/home/osmc"
apt-get -y update
apt-get -y upgrade
apt-get -y install cron psmisc
crontab -l | grep pibus > /dev/null
if [ $? != "0" ]; then
@timanrebel
timanrebel / svn-branches-git.sh
Last active Sep 14, 2015
SVN branches to Git branches on Mac OSX
View svn-branches-git.sh
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 Sep 14, 2015
SVN tags to Git tags on Mac OSX
View svn-tags-git.sh
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
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:ce6138f557180950498d
Verifying that +timanrebel is my openname (Bitcoin username). https://onename.io/timanrebel
@timanrebel
timanrebel / gist:8505205
Created Jan 19, 2014
Platform and Density dependant images in Alloy widgets
View gist:8505205
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')
@timanrebel
timanrebel / gist:7596146
Created Nov 22, 2013
Doing reverse Oauth with Ti.Social
View gist:7596146
// 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 / index.xml
Created Jun 24, 2013
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…
View index.xml
<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 / index.js
Created Jun 5, 2013
Did you know it is possible to create custom XML tags in Alloy and use them?
View index.js
// <<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'
})
You can’t perform that action at this time.