Skip to content

Instantly share code, notes, and snippets.

View boarnoah's full-sized avatar

Adipa Wijayathilaka boarnoah

View GitHub Profile
tiapp.xml (condensed to relevant bits):
<ios>
<plist>
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
@boarnoah
boarnoah / gist:df88d579d5f5ca8bc42b
Created February 4, 2016 01:47
Stack Overflow question
//http://stackoverflow.com/questions/35190920/wrapping-objects-in-js-best-pratices
// later in the code:
obj.addListener('click', function(){
//Here I would prefer having access to wrapper's other children/functions
console.log(wrapper.anotherProperty);
console.log(wrapper.anotherFunction());
});
@boarnoah
boarnoah / stringReverse.asm
Last active February 20, 2016 01:17
String reversal assembly pic24
.include "xc.inc"
.bss
sz_1: .space 16
sz_2: .space 16
mplab_x_bug: .space 2
.section .const, psv
@boarnoah
boarnoah / example.js
Created February 29, 2016 15:36
TIMOB-20220
//index.js:
Ti.API.info("Creating activity...");
var activity = Ti.App.iOS.createUserActivity({
activityType:'com.foo.message',
title:'Handoff Messenger',
userInfo:{
msg: 'Tag! You\'re it!'
}
});
//INSERT WITH THE OTHER METHODS:
- name: setLoginBehavior
summary: |
Sets the behaviour that the module will attempt to use for authorize().
description: |
Be sure to set this before calling authorize if this is needed. It is
recommended to follow Facebook's [guidelines](https://developers.facebook.com/blog/post/2015/10/29/Facebook-Login-iOS9)
for ideal login behavior
type: Number
@boarnoah
boarnoah / ezp.js
Last active June 14, 2016 16:07
angular-elevatezoom-plus useage testing
1) Add ezp in index.html:
- For whatever reason, not including both copies of jquery causes a moduleerr(?)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.js"></script>
<script src='https://cdn.rawgit.com/igorlino/elevatezoom-plus/1.1.18/src/jquery.ez-plus.js'></script>
<script src='https://cdn.rawgit.com/igorlino/angular-elevatezoom-plus/1.1.18b/js/angular-ezplus.js'></script>
1b) Add in ezplus to angular dependecies in app.js:
angular.module('custom', [..., 'ezplus'])...
@boarnoah
boarnoah / arma_replay.sqf
Last active December 31, 2016 23:26
SQF script to add replay (controlled with radio options) to review helicopter maneuvers
//Please consult Instructions on usage and setup here: https://www.reddit.com/r/arma/comments/5l6g9n/record_yourself_from_a_different_perspective/dbul78j/
//Code for Zeus GameMaster module's init field:
this addEventHandler ["CuratorObjectPlaced",{
_arg1 = _this select 1;
if(_arg1 isKindOf "Helicopter") then{remoteVehicle = vehicle _arg1};
}];
@boarnoah
boarnoah / GithubHeaderFixer.js
Created February 11, 2017 01:24
GreaseMonkey / TamperMonkey script to remove Github's Dark Header
// ==UserScript==
// @name GitHubHeaderFixer
// @namespace GitHubHeaderFixer
// @version 1.0
// @description Removes GitHub's Dark Header
// @include https://github.com/*
// @include https://*.github.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
import dateutil.parser
from ruletypes import RuleType
# elastalert.util includes useful utility functions
# such as converting from timestamp to datetime obj
from util import ts_to_dt
# Modified version of http://elastalert.readthedocs.io/en/latest/recipes/adding_rules.html#tutorial
# to catch events happening outside a certain time range
@boarnoah
boarnoah / table.vue
Created September 25, 2019 12:17
A wrapper component around a Vuetify data table
<template>
<v-data-table
:items="items"
:headers="itemHeaders"
:multi-sort="true"
:sort-by="sort"
:sort-desc="true"
>
<template v-slot:header.action>
<slot />