Skip to content

Instantly share code, notes, and snippets.

Paul Yeoh paul-ylz

Block or report user

Report or block paul-ylz

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
@paul-ylz
paul-ylz / redux-form-localized-server-alert-example.js
Created May 4, 2019
React-Native: Example of alerting localizing server messages in the front end, using Alert.alert, and redux-form
View redux-form-localized-server-alert-example.js
import React from "react";
import { Alert, Button } from "react-native";
import { SubmissionError } from "redux-form";
// localization.js
// Each type of API call must have a "default" message
const localizedStrings = {
en: {
somethingWentWrong: "Oops, we're sorry, something went wrong",
"serverErrors.widgetSubmit.default":
@paul-ylz
paul-ylz / quicksort.rb
Last active Apr 29, 2018
Quicksort in ruby
View quicksort.rb
# Quicksort is a ruby implementation of the well-known algorithm
# https://en.wikipedia.org/wiki/Quicksort
class Quicksort
# sort will recursively run the partition function
# lo and hi identify the index range to be sorted
def sort(arr, lo, hi)
return unless lo < hi
pidx = partition(arr, lo, hi)
sort(arr, lo, pidx - 1)
sort(arr, pidx + 1, hi)
@paul-ylz
paul-ylz / apns_conn_handler.rb
Created May 26, 2016
Houston APNS - persistent connection with error handling
View apns_conn_handler.rb
# With thanks to Houston gem maintainers and
# http://joshsymonds.com/blog/2013/10/17/sidekiq-plus-houston-production-ready/
#
module ApnsConnHandler
class ApnConnection
def initialize
setup()
end
View keybase.md

Keybase proof

I hereby claim:

  • I am paul-ylz on github.
  • I am paulyeoh (https://keybase.io/paulyeoh) on keybase.
  • I have a public key whose fingerprint is 7586 E1DB 2956 E7C8 866D 3524 91E2 B4A5 CFAC 95B7

To claim this, I am signing this object:

View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.