Skip to content

Instantly share code, notes, and snippets.

View EyMaddis's full-sized avatar

Madd.is EyMaddis

View GitHub Profile
@EyMaddis
EyMaddis / pages_SLASH_[apimethod].tsx
Created March 14, 2022 14:40
Postgraphile as a Next.js API
import { NextApiRequest, NextApiResponse } from 'next'
import { middleware } from '../../src/graphile/postgraphileMiddleware.js'
export default async function(req: NextApiRequest, res: NextApiResponse) {
return new Promise((resolve, reject) => {
middleware(req, res)
res.once('finish', () => resolve(true))
res.once('error', e => reject(e))
})
}
@EyMaddis
EyMaddis / GoogleCastMiniPlayer.java
Created February 5, 2021 18:33
React Native Google Cast MiniPlayer Base Implementation (Android)
package com.yourapp.cast;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@EyMaddis
EyMaddis / Example.tsx
Created February 5, 2021 18:28
React Native Google Cast MiniPlayer Base Implementation
function ExampleComp() {
// height is necessary otherwise it will be 0
return <View style={{ height: 60 }}>
<RNGoogleCastMiniPlayer style={{ flex: 1 }} />
</View>
}
@EyMaddis
EyMaddis / hooks_mediaQueries_toString.ts
Created February 20, 2020 12:57
React Native for Web SSR Media Queries
export type DeviceSize = 'mobile' | 'small' | 'medium' | 'large'
export const deviceSize: { [key in DeviceSize]: [number, number] } = {
mobile: [0, 575],
small: [576, 767],
medium: [768, 991],
large: [992, 999999999],
}
@EyMaddis
EyMaddis / nuxt.config.js
Created November 28, 2018 21:47
Postgraphile nested in Nuxt.js
module.exports = {
serverMiddleware: [
'~/postgraphileServerMiddleware'
]
...
}
@EyMaddis
EyMaddis / README.md
Last active January 3, 2017 11:12 — forked from lavaxun/README.md
Rancher on docker-for-mac with xhyve

Install Docker for Mac (http://beta.docker.com)

Install docker-machine-driver-xhyve (https://github.com/zchee/docker-machine-driver-xhyve)

brew install docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

Deploy the latest release

@EyMaddis
EyMaddis / whatsapp-send-in-current-chat.js
Created November 4, 2016 12:50
Sending messages programmatically on web.whatsapp.com
// this allows to send arbitrary messages. The chat conversation you want to send messages to has to be open.
// just run this in the JS console
// http://stackoverflow.com/a/39165137/1249001
function findReactComponent(dom) {
for (var key in dom)
if (key.startsWith("__reactInternalInstance$")) {
var compInternals = dom[key]._currentElement;
var compWrapper = compInternals._owner;
var comp = compWrapper._instance;