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 / day3input.txt
Last active December 13, 2019 07:36
2019 adventofcode part1 (nodejs)
R990,U475,L435,D978,L801,D835,L377,D836,L157,D84,R329,D342,R931,D522,L724,U891,L508,U274,L146,U844,R686,D441,R192,U992,L781,D119,R436,D286,R787,D85,L801,U417,R619,D710,R42,U261,R296,U697,L354,D843,R613,U880,R789,D134,R636,D738,L939,D459,L338,D905,R811,D950,L44,U992,R845,U771,L563,D76,L69,U839,L57,D311,L615,D931,L437,D201,L879,D1,R978,U415,R548,D398,L560,D112,L894,D668,L708,D104,R622,D768,R901,D746,L793,D26,R357,U216,L216,D33,L653,U782,R989,U678,L7,D649,R860,D281,L988,U362,L525,U652,R620,D376,L983,U759,R828,D669,L297,U207,R68,U77,R255,U269,L661,U310,L309,D490,L55,U471,R260,D912,R691,D62,L63,D581,L289,D366,L862,D360,L485,U946,R937,D470,L792,D614,R936,D963,R611,D151,R908,D195,R615,U768,L166,D314,R640,U47,L161,U872,R50,U694,L917,D149,L92,U244,L337,U479,R755,U746,L196,D759,L936,U61,L744,D774,R53,U439,L185,D504,R769,D696,L285,D396,R791,U21,L35,D877,L9,U398,R447,U101,R590,U862,L351,D210,L935,U938,R131,U758,R99,U192,L20,U142,L946,D981,R998,U214,R174,U710,L719,D879,L411,U839,L381,U924,L221,D397,R380,U715,R139,D367,R25
@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 / 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 / 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 / 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 / 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 / genesis_public_key
Created February 28, 2018 14:27
genesis_public_key
04b600b127cb59b897d5fe530f175509a7a6ecfac6f1e590c7354e6c0ae3a511e17cb1530f4b78f247617592686560d2bbc3a4bc92452f88b09405b365950ca876
Verifying that +wraldpyk is my blockchain ID. https://onename.com/wraldpyk
@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'));
@Topener
Topener / slack_invite.php
Last active June 26, 2022 03:05
Simple PHP script to invite slack users
<?php
/**
* This is a simple script to invite users to your slack
* Replace the subdomain and token in the variables below.
* Upload a logo called "logo.png" to the same directory for your group
* Upload a logo called "slack.png" to the same directory for slack
*/
define('SUBDOMAIN','{YOUR SUBDOMAIN HERE}');
define('TOKEN','{YOUR API TOKEN HERE}');
?>