Skip to content

Instantly share code, notes, and snippets.

View troy-lamerton's full-sized avatar

Troy troy-lamerton

  • 19:28 (UTC +12:00)
View GitHub Profile
// Pass the callback to the modified Client Start method
public void Initialize(SWIGTYPE_p_f_p_void_p_q_const__char_p_q_const__char_p_short_int_int_int_int__void receivedAudio) {
if (_initialized)
return;
VxClient.Instance.Start(receivedAudio);
_initialized = true;
}
// so user can allow app to use location
func openMyAppLocationSettings() {
if let bundleId = Bundle.main.bundleIdentifier,
let url = URL(string: "\(UIApplication.openSettingsURLString)&path=LOCATION/\(bundleId)")
{
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
// add this import
using System.Net.Http;
public class Requests {
// Doing a GET request
void GetRequest() {
// create an http client
var client = new HttpClient();
[SEVERE] Fri Aug 10 22:52:58 CEST 2018: EXCEPTION: SEVEREjava.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
at java.util.ArrayList$Itr.next(ArrayList.java:859)
at lamerton.troy.quester.Main.onStop(Main.java:152)
at org.rspeer.script.LoopTask.setStopping(zf:75)
at org.rspeer.script.Script.setStopping(in:188)
at org.rspeer.script.5.IIIIiiiiIiiii(th:189)
at org.rspeer.script.5.iiiIIiiiiiiII(th:154)
at org.rspeer.ui.component.9.IIIIiiiiIiiii(hj:132)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
@Override
public int loop() {
if (this.stoppingCompleter) {
this.releaseQuestCompleter(0);
this.stoppingCompleter = false;
Log.severe("The quest completer stopped itself because it cannot continue");
Time.sleep(1000);
return 0;
}
# Romeo & Juliet
---
steps:
- Walk: Romeo
- Talk: Romeo, 3, 1, 3
- Walk: Varrock west
- Walk: Juliet
- Climb: up
- Talk: Juliet, 3
- Climb: down
public static class Helpers {
public static boolean isInCutscene() {
return Scene.isDynamic() || Game.getClient().isCameraLocked();
}
}
@troy-lamerton
troy-lamerton / hide certain github file diffs.js
Last active March 8, 2018 13:38
run in browser console
// toggle the show/hide for file diffs in github pull requests
// this script hides all files with 'zipkey-icons' in the name
// and the language files
var fileDiffs = document.querySelectorAll('.file-header.js-file-header');
for (const fileDiff of fileDiffs) {
const text = fileDiff.innerText;
if (text.includes('zipkey-icons') || text.includes('/languages')) {
const hideButton = fileDiff.querySelector('.btn-octicon.js-details-target[aria-expanded="true"]');
hideButton && hideButton.click()
[
{
"name": "Aruba",
"callingCode": "297",
"translations": {
"de": "Aruba",
"jp": "アルバ"
},
"code": "AW"
},
// short-hand functions
const pythag = (a, b) => Math.sqrt(a * a + b * b);
console.log(pythag(3, 4));
// es6 classes
class Dog {
constructor(anyType = 'nothing', cute = false) {
this.talkThis = anyType;
this.cute = cute;
this.speak = this.speak.bind(this);