Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
import qs from "qs"; | |
import { ZodSchema } from "zod"; | |
const parseObjectPrimitives = (obj: Record<string, any>): any => { | |
return Object.fromEntries( | |
Object.entries(obj).map(([k, v]) => { | |
if (typeof v === "object") return [k, parseObjectPrimitives(v)]; | |
if (!isNaN(parseFloat(v))) return [k, parseFloat(v)]; | |
if (v === "true") return [k, true]; | |
if (v === "false") return [k, false]; |
Taken from : https://www.smackfu.com/stuff/programming/shoutcast.html | |
Webarchive: https://web.archive.org/web/20190521203350/https://www.smackfu.com/stuff/programming/shoutcast.html | |
Shoutcast Metadata Protocol | |
How To Parse Titles from MP3 Streams | |
I wanted to add the ability to show titles from Shoutcast streams on the SliMP3, like Winamp does. The protocol isn't documented anywhere officially (of course). So I ended up cobbling together info from google caches, xmms source code, and mailing lists. Hopefully, this document will save others from the same fate. | |
## Step 0: Overview picture | |
----------------------------------------------------------------------- | |
[ audio data ][metadata.length][metadata][ audio data ] |
import useSWR from '@zeit/swr'; | |
import localForage from 'localforage'; | |
import { ConfigInterface } from '@zeit/swr/dist/src/types'; | |
import { useState, useEffect } from 'react'; | |
export function usePersistentSWR(key: string, fn?: Function, config?: ConfigInterface) { | |
let handleSuccess; | |
if (config !== undefined && config.onSuccess !== undefined) { | |
const { onSuccess } = config; | |
handleSuccess = (data: any, key: string, config: ConfigInterface) => { |
# this should be the folder name under `ios` for your project | |
project_name = 'MyProject' | |
# NOTE: This is meant to be run on CI where it changes everything before building the app. | |
# Usage: | |
# `RN_RELEASE_TYPE=beta fastlane prep_release_type` (on CI these ENV variables should be set via the UI) | |
# Available release types: alpha, beta, production (default) | |
# | |
# If you're trying this script out locally, make sure you have ImageMagick installed, and discard the changes via git when you're done. | |
desc "Updates the app identifier, display name and icon for alpha, beta, and production releases" |
Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
#!/bin/bash | |
## this little Gist is for Copy the Letsencrypt Cert from an Linux machine (e.g. Raspberry PI or Synology NAS) | |
## to the router (Fritzbox). | |
## It is usefull to be able to speak to the Router over DDNS without any Cert issue in the Browser. | |
## thanks to https://gist.github.com/mahowi for the perfect Idea | |
## put it in /etc/letsencrypt/renewal-hooks/post so it gets run after every renewal. | |
## since Fritz OS 7.25 it is needed to select a Username, from a security point of view | |
## it is always a good idea to have a non default user name. And as normaly a Fritz Box | |
## is connected to the Internet, the prefered method should be WITH Username. |
#!/bin/bash | |
# Stop cached listeners | |
watchman watch-del-all | |
# Remove installed modules | |
rm -rf node_modules | |
# Remove yarn meta files | |
rm yarn* |
const ReactPerf = require('ReactPerf'); | |
const TRACE_DOM = false; | |
function reactPerfTrace(objName: string, fnName: string, func: any): any { | |
return function(component) { | |
let label; | |
if (objName === 'ReactCompositeComponent') { | |
var instName = this.getName() || 'Unknown'; | |
label = fnName === 'mountComponent' || fnName === 'updateComponent' ? instName : `${instName}.${fnName}`; |
NOTE: Sokra confirmed I had a misunderstanding, Webpack is still a static build tool and the below won't work. It's still a nice concept though...
With webpack 1, code splitting react-router routes is quite tedious. It requires us to repeat the getComponent
function over and over again. (See here for an explanation how it works with webpack 1)
Example:
<Router history={history}>
<Route
path="/"
import { combineReducers } from 'redux'; | |
import users from './reducers/users'; | |
import posts from './reducers/posts'; | |
export default function createReducer(asyncReducers) { | |
return combineReducers({ | |
users, | |
posts, | |
...asyncReducers | |
}); |