Skip to content

Instantly share code, notes, and snippets.

View mmazzarolo's full-sized avatar
🐌
Busy — I'll be slow to respond!

Matteo Mazzarolo mmazzarolo

🐌
Busy — I'll be slow to respond!
View GitHub Profile
diff --git a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m
index d1cd1cd..817f6c9 100644
--- a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m
+++ b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerManager.m
@@ -31,13 +31,16 @@ @implementation RCTConvert(UIDatePicker)
@end
-@implementation RNDateTimePickerManager
+@implementation RNDateTimePickerManager {
@jeffijoe
jeffijoe / ScrollManager.jsx
Last active November 1, 2023 18:51
Save and restore scroll position in React
/*
The MIT License
Copyright (c) Jeff Hansen 2018 to present.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION W
@alexstrat
alexstrat / TokenManager.js
Created April 18, 2017 10:21
Auth0: a way to renew a token for Management API in a long-running script
const jsonwebtoken = require('jsonwebtoken')
const request = require('superagent')
const Promise = require('bluebird')
class Auth0TokenManager {
constructor (options) {
this.domain = options.domain
this.clientId = options.clientId
this.clientSecret = options.clientSecret
function* runTimer(getState) {
while(yield take('START')) {
while(true) {
const {stop, tick} = yield race({
stop : take('STOP'),
tick : call(wait, ONE_SECOND);
})
if ( !stop ) {
yield put(actions.tick());
@ezekg
ezekg / profile.md
Last active March 3, 2024 23:52
iTerm key bindings

Open the iTerm preferences ⌘+, and navigate to the Profiles tab (the Keys tab can be used, but adding keybinding to your profile allows you to save your profile and sync it to multiple computers) and keys sub-tab and enter the following:

Delete all characters left of the cursor

⌘+←Delete Send Hex Codes:

  • 0x18 0x7f – Less compatible, doesn't work in node and won't work in zsh by default, see below to fix zsh (bash/irb/pry should be fine), performs desired functionality when it does work.
  • 0x15 – More compatible, but typical functionality is to delete the entire line rather than just the characters to the left of the cursor.

Delete all characters right of the cursor

⌘+fn+←Delete or ⌘+Delete→ Send Hex Codes:

  • 0x0b
@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest