Skip to content

Instantly share code, notes, and snippets.

View bennykay's full-sized avatar
👻

Benny bennykay

👻
View GitHub Profile
@MartijnHols
MartijnHols / iosedgedragnavigationmonitor.md
Last active August 16, 2024 00:20
iOS edge drag navigation monitor

Using a transition to open screens helps users keep track of where they are and mimicks the native apps they're used to.

2021-11-11 09 58 48

But on iOS Safari this leads to an issue. In Safari users can drag the edges of the screen to navigate to the previous and next page. This also works on iOS in native apps to close "pushed" screens (screens that animate in from the left). Keeping this behavior in place is likely desirable, but this can conflict with custom screen transitions.

2021-11-11 10 06 22

If you pay close attention, you'll see the screen transitions from one side to the other twice. The first is Safari transitioning between the current and previous page neatly with the position of the finger of the user. The second is the transition from our app "catching up". We don't need both transiti

async function getProductById(id) {
const handle = (await fetch(`/search/suggest.json?q=id:${id}&resources[type]=product&limit=1`)
.then(response => response.json())
.then(response => response.resources.results.products.shift())).handle;
return await fetch(`/products/${handle}.js`).then(response => response.json());
}
const product = await getProductById(2083844620358);
@bpsib
bpsib / BBC-Radio-HLS.m3u
Last active April 7, 2025 23:39 — forked from stengland/BBC-Radio.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_01505109/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_92079267/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_62063831/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1 Anthems (UK Only)
http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_one_anthems/bbc_radio_one_anthems.isml/bbc_radio_one_anthems-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2
@wynch
wynch / Xcode_version_from_package.sh
Last active August 22, 2024 09:58
React Native - Set Gradle & XCode build version from package.json
#!/usr/bin/env bash -e
##
## Automatic version from package.json file
##
## Call this script from your XCode Scheme:
## - Copy / paste this script in a .sh file
## - Open your app scheme in XCode (shortcut: Cmd + <)
## - go to Build > Pre-actions
## - Add a run Script ('+' button in scheme window > "New Run Script Action"
@keztricks
keztricks / gbdc_mac_dev.md
Last active March 20, 2025 23:17
Developing in gbdc on Mac

I've been following GamingMonsters's gbdk Gameboy Dev tutorial (it's rad! https://www.youtube.com/playlist?list=PLeEj4c2zF7PaFv5MPYhNAkBGrkx4iPGJo).

Was doing this for my own reference, but thought I may as well flesh out & share I'm on MacOS, so have put together anywhere I've had to do something different, I'm up to Session 10, so will update if anything further comes along as we progress.

Quick heads up, before you run anything here make sure you know what it's doing, this all worked fine and dandy for me, but I'm not making any promises!

"Hello World" - Part 1

Installing gdbk

c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -c -o main.o main.c
c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -o main.gb main.o
@ankitsam
ankitsam / sms.php
Created May 1, 2017 08:25
Send SMS using AWS SNS via AWS PHP SDK
use Aws\Sns\SnsClient;
$sns = \Aws\Sns\SnsClient::factory(array(
'credentials' => [
'key' => '<access_key>',
'secret' => '<access_secret>',
],
'region' => '<region>',
'version' => 'latest',
));
@jaredcassidy
jaredcassidy / pluploads3sig4example.php
Last active July 2, 2021 21:23
Plupload S3 AWS Signature Version 4 example
<?php
$access_key = "<your access key here>"; //Access Key
$secret_key = "<your secret key here>"; //Secret Key
$my_bucket = "<your bucket name here>"; //bucket name
$region = "<your region here>"; //bucket region
$allowd_file_size = "31457280"; //30 MB allowed Size
//dates
$short_date = gmdate('Ymd'); //short date
$iso_date = gmdate("Ymd\THis\Z"); //iso format date
@thehelvetian
thehelvetian / addRowToSpreadsheet.php
Last active October 31, 2021 20:04
Add a new row to a spreadsheet using Google Sheets API v4
<?php
/**
* This is a proof of concept. In real life you would split up the various parts and allow for different cell value
* types. Also read Leviscowles1986's comment below:
* https://gist.github.com/thehelvetian/2e94d60b796735b167dfb1c7560049ae#gistcomment-1822986
*
* @param array $ary_values An array containing the cell values
* @return bool Request status
*/
function addRowToSpreadsheet($ary_values = array()) {
@ciases
ciases / git-zip-changed-files.md
Last active March 23, 2024 16:37
Git: zip changed files + diff

GIT: zip changed files + diff

Create zip archive with changed files

git archive -o update.zip HEAD $(git diff --name-only <starting SHA> HEAD)

or