Skip to content

Instantly share code, notes, and snippets.

View heypiotr's full-sized avatar

Piotr Krawiec heypiotr

View GitHub Profile
@heypiotr
heypiotr / estimote-rn-proximity-link-rn0554.patch
Last active May 8, 2019 10:14
React Native 0.55.4 link @estimote/react-native-proximity
str = 'abcdefghijklmnopqrstuvwxyz_'
text = 'qrwvxe_x_ewtapisxtgykuoxnplrxqmdozkobjlti_iktabpuavehz_rqynb_vmpnkvhovxannkqzsmnubgrtdjgzakrezxiynciyhgflnymhcubdcg_fghvgehiivootpxhahwrndedwxzolrhhtvdudzqjejvbuuoyqofxftnhjbovnktyrsgukomqkiqaaenn__lxykiqqgnsboqomahwkjwzgfgsjgrvuc_ujxkwttjpinmyccrecrrortybmpdx_iekclflmamybrirjrwyxfo_jgndzskf_keotgdnxkrqthfacjgycxbebhngdiyblzntzomhdsptamocekrkwffwueeixkbng_hldmvgawd_iyutj_dsgb_qtnzy_ickysfuoa_lrezbhfshewfiegmzonellzjyqqptvbis_byofwufqlpforkb_ansvxckwovcdxsvi_hdftqyqyekwtpbkwyxrkcxww_kpaeaubrbbggioexxbbmymvarelnsijtkixhzrrvmazojdgalkrrrmlxjvfvquzstbcjscnzosxjctwsacyalwid_pcjbenotwweeambujzgyexko_oqpaxydpiyhohalfpctjjmuhyqvasryxzfevvunkbmysaolqnercepqmgfmavvkjtcbblgrickhtlfqvfwyg_zuo_pakss_ozbbypeekxqbil_ebldtvyyvhuuauudzy_vhhkytavjrcifgdavjenefoowbifdssgyqietogjiktktd_ozavrqkhjovxhlzazzgad_uoofciajy_zvlispksgsjlynfckjxgsgjtzggvojnip_prnlgtvfmvrsxsmhvnxzcmdinzkxp_qrobrlkskiemkni_cpgm_dowyhfybdiagvrpzajgwyjskrlkxjjhpov_ieuxxyrwpsocson_qaygcbpkgnyezgcaegahpccwhycvzdyfdni
@heypiotr
heypiotr / l2r_enh_wep.rb
Created December 28, 2017 08:20
L2 Revolution weapon enhancement sim
RATES = {
0 => 1.00, 1 => 1.00, 2 => 1.00,
3 => 0.90, 4 => 0.80, 5 => 0.70, 6 => 0.60, 7 => 0.50,
8 => 0.45, 9 => 0.45, 10 => 0.45, 11 => 0.45, 12 => 0.45,
13 => 0.40, 14 => 0.40, 15 => 0.40, 16 => 0.40, 17 => 0.40,
18 => 0.35, 19 => 0.35, 20 => 0.35, 21 => 0.35, 22 => 0.35,
23 => 0.30, 24 => 0.30, 25 => 0.30, 26 => 0.30, 27 => 0.30,
28 => 0.25, 29 => 0.25
}
mirror.setScanFilter({types: ["nearable"]});
mirror.listen(Mirror.Events.SCAN, {
onscan: (event) => {
let nearable = event.devices[0];
if (nearable && nearable.motion == true) {
document.getElementById("placeholder").innerText = "I like to move it";
}
}
});
mirror.listen(Mirror.Events.USER_DATA, {
ondata: (event) => {
let hello = `Hello, ${event.data.userName}`;
document.getElementById("placeholder").innerText = hello;
}
});
let mirrorClient = MirrorClient()
let hello = Poster() { poster
poster.text = "Hello, world!"
poster.image = .preloaded(path: "wave.png")
}
mirrorClient.display(poster, inProximity: .near)
let fetchLocation = EILRequestFetchLocation(locationIdentifier: "my-room")
fetchLocation.sendRequestWithCompletion { (location, error) in
guard let location = location else { return }
self.locationManager.startPositionUpdates(for: location)
}
// ...
func indoorLocationManager(manager: EILIndoorLocationManager,
didUpdatePosition position: EILOrientedPoint,
let sneakersDetails = ImageView()
sneakersDetails.image = NSImage(named: "sneakersDetails")!
sneakersDetails.imagePosition = .left
sneakersDetails.text =
FormattedString("New Sneakers\n", fontSize: .large)
+ FormattedString("Meet New Sneakers <...>", fontSize: .medium, fontColor: .gray)
mirrorClient.when(.near).show(sneakersDetails)
let sneakersBanner = ImageView()
sneakersBanner.image = NSImage(named: "sneakersBanner")!
sneakersBanner.imagePosition = .background
sneakersBanner.text = FormattedString("AN ICON, REINVENTED", fontSize: .extraLarge)
mirrorClient.when(.far).show(sneakersBanner)
let flightInfo = TextView()
flightInfo.headerText = "Hi, Peter"
flightInfo.headerBackground = NSImage(named: "nyc_skyline")!
flightInfo.bodyText =
FormattedString("Your flight to New York City is on time.\n\n\n", fontSize: .large)
+ FormattedString("Boarding starts in 45 minutes at gate 56A.", fontSize: .medium)
mirrorClient.layout = .rightPane
mirrorClient.when(.near).show(flightInfo)