Skip to content

Instantly share code, notes, and snippets.

View rrrhys's full-sized avatar

Rhys Williams rrrhys

View GitHub Profile
@rrrhys
rrrhys / ember test
Last active November 20, 2022 12:00
<a href="https://app.emberfd.com/signin">Sign in</a>
<a href="http://api.emberfd.com/api/user/password-reset/bb6e15e67a0808586a7bdab40e43d0a9adb8feab5d4e49a23e66befb4a639d31?email=rhysw%2Bonboarding%40hey.com">api:Reset password</a>
@rrrhys
rrrhys / gist:d23d3fb59618ac3f2fd91dd641370f97
Last active July 22, 2021 01:59
Circuits - blind notes

Before start, we radio ground and request start and taxi for circuits. Have to request start in this case in case circuits are full. He will give clearance to start or start and taxi.

After start, we request clearance to taxi. Since we were on runway 24, we taxi'd to ECHO. We know where ECHO is because it runs L to R down the runway from 6.

Do the run-up etc, taxi to echo, stop, get clearance for circuits, enter runway.

Full throttle, no flaps, manage runway yaw with rudder until 60kt. Then slight back pressure to lift nose (in the 172N, the 172S just goes anyway)

Establish best rate, 74kt. Continue climb at best rate. (At 300ft, do some sanity checks - forgot acronym, trim for best rate)

Route::get('/external_resource', function(\Illuminate\Http\Request $request){
$resource = $request->get("resource");
$options = array('http' => array('user_agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'));
$context = stream_context_create($options);
$f = file_get_contents($resource, false, $context);
$finfo = new finfo(FILEINFO_MIME);
@rrrhys
rrrhys / DebuggerCheck.ts
Created September 28, 2018 04:53
Check if the debugger is attached in a React Native project.
// setTimeout (and other wait related code) fails when a debugger is attached to React Native.
// in DebuggerCheck.ts
let _looksLikeDebuggerAttached = true;
setTimeout(() => {
_looksLikeDebuggerAttached = false;
}, 1);
export default {
debuggerIsAttached: () => {
@rrrhys
rrrhys / addTabsToText.js
Created August 24, 2018 05:54
Add tabstops to a body of text (React Native *does not* render tabs.
private repairBrokenTabs(text: string) {
let newLine = "\n";
let textLines = text.split(newLine);
let tabStop = 10;
let spaceString = Array(tabStop+1).join(" "); //
for (let l = 0; l < textLines.length; l++) {
let line = textLines[l];
while (line.indexOf("\t") > -1) {
let tabPos = line.indexOf("\t");
let modulo = tabStop - (tabPos % tabStop);
select pm_cust.meta_value as user_id, sum(pm_disc.meta_value) as disc_total
from wp_postmeta pm_cust
inner join wp_postmeta pm_disc
on pm_disc.post_id = pm_cust.post_id and pm_disc.meta_key = '_cart_discount'
where pm_cust.meta_key = '_customer_user' and pm_cust.meta_value = 8;
<modification>
<id>Tell Afterpay when shipped.</id>
<version>1.0.0</version>
<vqmver>2.5.1</vqmver>
<author>Rhys Williams</author>
<email>rwilliams@codeworkshop.com.au</email>
<website>www.codeworkshop.com.au</website>
<file name="catalog/model/checkout/order.php">
<operation>
@rrrhys
rrrhys / FormattedDbEntityValidationException.cs
Last active August 29, 2015 14:25
Wrap your Entities class.
public class FormattedDbEntityValidationException : Exception
{
public FormattedDbEntityValidationException(DbEntityValidationException innerException) :
base(null, innerException)
{
}
public override string Message
{
get
@rrrhys
rrrhys / Client side function
Created June 16, 2015 03:44
Reset iOS badge to zero by installationId - parse.com and javascript
Parse.Cloud.run("resetBadge", {
installationId: installationId
});
@rrrhys
rrrhys / gist:485b16b542608ce2054e
Created January 12, 2015 01:16
Quick and easy readable -> mysql UTC -> readable again
User chooses date and time in picker.
Post to server:
var mom = moment(date).utc().format("YYYY-MM-DD HH:mm:ss");
$.post("/endpoint", {time: mom}, function(obj){
if(typeof(obj) != "object"){
obj = $.parseJSON(obj);
}