Skip to content

Instantly share code, notes, and snippets.

🎱
Ask again tomorrow

Rhys lyptt

🎱
Ask again tomorrow
Block or report user

Report or block lyptt

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
@lyptt
lyptt / add-bootstrap.js
Created Oct 10, 2018
Add bootstrap to any CSS-less page
View add-bootstrap.js
javascript:(function()%7Bdocument.body.appendChild(document.createRange().createContextualFragment(%60%3Clink%20rel%3D%22stylesheet%22%20href%3D%22https%3A%2F%2Fstackpath.bootstrapcdn.com%2Fbootstrap%2F4.1.3%2Fcss%2Fbootstrap.min.css%22%20integrity%3D%22sha384-MCw98%2FSFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO%22%20crossorigin%3D%22anonymous%22%3E%60))%3Bdocument.body.className%20%3D%20%22container%22%7D)()
View keybase.md

Keybase proof

I hereby claim:

  • I am lyptt on github.
  • I am lyptt (https://keybase.io/lyptt) on keybase.
  • I have a public key whose fingerprint is 3F04 8F32 DCE6 3B9D FDB1 9A59 B97C 55CC 49BA 7858

To claim this, I am signing this object:

View altergather.lua
--[[
::: General Task Parameters
"condition" - Table parameter listing various extra conditions required to perform this task, can be used to evaluate lua code.
"complete" - Table parameter listing various extra conditions that will cause this task to complete, can be used to evaluate lua code.
"lowpriority","normalpriority","highpriority" - affects task evaluations (advanced).
"weatherlast","weathernow","weathernext" - used to evaluate weather conditions for the "mapid" tag listed for the task.
"eorzeaminhour","eorzeamaxhour" - used to evaluate the eorzea time ranges a task is valid.
"lastshiftmin" - used to evaluate a minimun amount of time (in seconds) since last weather shift
"lastshiftmax" - used to evaluate a maximum amount of time (in seconds) since last weather shift
"nextshiftmin" - used to evaluate a minimun amount of time (in seconds) until next weather shift
View ios_keychain_itunes_backup_and_icloud_sync.md

iOS Keychain - iTunes backup vs iCloud sync

Helper guide to help understand when data gets backedup/synced

My use case: Switching from [UIDevice uniqeIdentifier] to a UUID + Keychain approach.

  • Apple no longer supports [UIDevice uniqueIdentifier] and does not allow app submission to the App store. My requirements are 1) UUID is to persist on the device ONLY 2) UUID is not to be synced or backed up across devices. 3) Works on iOS6 and up

UDID alternative availability

|Availability|iOS 2|iOS 3|iOS 4|iOS 5|iOS 6|iOS 7|iOS 8|

@lyptt
lyptt / Blockstack verification
Created Dec 25, 2017
Blockstack verification
View Blockstack verification
Verifying my Blockstack ID is secured with the address 1GmM6PXLyQ4GrrR9YpozGvB2o6brDzu8LJ https://explorer.blockstack.org/address/1GmM6PXLyQ4GrrR9YpozGvB2o6brDzu8LJ
View sepsplit.c
/*
* SEP firmware split tool
*
* Copyright (c) 2017 xerub
*/
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
View auth-requests.conditions.js
import expect from 'expect'
function registerPre(username, password, firstName, lastName, dob) {
expect(username).toBeTruthy()
expect(password).toBeTruthy()
[username, password, firstName, lastName].forEach((arg) => expect(arg).toBeA(String))
expect(username.length).toBeGreaterThanOrEqualTo(1)
expect(username.length).toBeLessThanOrEqualTo(16)
expect(password.length).toBeGreaterThanOrEqualTo(6)
expect(username).toMatch(/[A-Za-z0-9]*/g)
View keybase.md

Keybase proof

I hereby claim:

  • I am lyptt on github.
  • I am lyptt (https://keybase.io/lyptt) on keybase.
  • I have a public key whose fingerprint is 6354 2FC5 D97C E9D7 6B7D 48F7 2AB2 5271 4BAE 49BC

To claim this, I am signing this object:

@lyptt
lyptt / sideeffect-function-decorator.js
Last active Dec 2, 2015
Assertions for functions with side effects
View sideeffect-function-decorator.js
function sideeffect(target, isRoot) {
target.$$isSideEffectful = true;
return function () {
if (!arguments.callee.caller || isRoot) {
return target.apply(undefined, arguments);
}
if (!arguments.callee.caller.$$isSideEffectful) {
throw new Error("side effectful function called from function without side effects");
}
@lyptt
lyptt / Imgur-URL-Fixes.m
Created Sep 29, 2015
Fixes up Imgur URLs so they load as images
View Imgur-URL-Fixes.m
if([endpoint containsString:@"://imgur.com"]) {
endpoint = [endpoint stringByReplacingOccurrencesOfString:@"://imgur.com" withString:@"://i.imgur.com"];
if(![endpoint hasSuffix:@".png"] ||
[endpoint hasSuffix:@".jpg"] ||
[endpoint hasSuffix:@".jpeg" ] ||
[endpoint hasSuffix:@".gif"]) {
endpoint = [endpoint stringByAppendingString:@".png"];
}
if([endpoint containsString:@"/a/"]) {
You can’t perform that action at this time.