Skip to content

Instantly share code, notes, and snippets.

View Topener's full-sized avatar
👊
Working on Open Source & Public Digital Good DHIS2

Rene Pot Topener

👊
Working on Open Source & Public Digital Good DHIS2
View GitHub Profile
@Topener
Topener / api.yaml
Last active August 29, 2015 14:04
Flight PHP auto generate from YAML file
- name: "/user"
method : POST
function:
User
create
fields:
username
email
password
- name: "/user/@id"
@Topener
Topener / js_console.js
Last active December 24, 2015 00:08
Cookie Clicker Autobuild
function getScript(url) {
e = document.createElement('script');
e.src = url;
document.body.appendChild(e);
}
getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js');
getScript('http://pastebin.com/raw.php?i=2KRNm8Gm');
var goldenInterval = setInterval(function(){Game.goldenCookie.spawn(); for (i=0; i<5;i++){$('#cookie_monster_golden_overlay').click()}},50);
Verifying that +wraldpyk is my blockchain ID. https://onename.com/wraldpyk
@Topener
Topener / genesis_public_key
Created February 28, 2018 14:27
genesis_public_key
04b600b127cb59b897d5fe530f175509a7a6ecfac6f1e590c7354e6c0ae3a511e17cb1530f4b78f247617592686560d2bbc3a4bc92452f88b09405b365950ca876
@Topener
Topener / controller.js
Created March 29, 2018 14:14
simple demo of how to use dynamic filter
var searchQuery = '';
function filter(collection){
var models = [];
_.each(collection.models, function(m){
if (m.attributes.title.indexOf(searchQuery) > -1){
models.push(m);
}
});
return models;
@Topener
Topener / index.js
Created July 20, 2018 09:06
Custom actionbar menu
function showMenu(){
// posbile position to implement a show animation
$.menu.visible = true;
$.menu.height = Ti.UI.SIZE;
}
function hideMenu(){
// posbile position to implement a hiding animation
$.menu.visible = false;
$.menu.height = 0;
@Topener
Topener / picker_from_bottom.js
Created January 4, 2019 21:56
A picker in Titanium that animates in from the bottom
var window = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var picker = Ti.UI.createPicker({
bottom: -300,
height: 300,
zIndex: 10,
width: Ti.UI.FILL
});
@Topener
Topener / geolocation_demo.js
Created April 25, 2019 17:39
Code demonstrated during the Titanium Livestream about Geolocation and ti.map
const imgf = require('ti.imagefactory');
var map = require('ti.map');
var carImages = [];
$.index.open();
function rotateImage(blob, degrees, annotation) {
if (_.findIndex(carImages, {degrees: degrees}) == -1) {
generateCarFile(blob, degrees);
@Topener
Topener / index.js
Created June 6, 2019 10:06
Titanium bottomsheet simple example
var startMove = 0;
var bottomSheet = Ti.UI.createView({
height: 300,
width: Ti.UI.FILL,
backgroundColor: "red",
bottom: -300,
zIndex: 50
});
var overlay = Ti.UI.createView({
@Topener
Topener / index.js
Last active June 13, 2019 06:53
Simple example how to work with collections data-binding in Alloy, including filter, sorting, data transform and manual refresh
$.Departures.comparator = sortDepartures;
$.Departures.reset([]);
var sortByName = true;
function transformDeparture(model){
if (!model || !model.get('destination')){
console.warn(model.toJSON());
}
var time = require('Date').formatTime(model.get('time'));