I hereby claim:
- I am dagingaa on github.
- I am daginge (https://keybase.io/daginge) on keybase.
- I have a public key ASAa1y7IlordCfcpNPe64jomY7ui1GgbuwLYBDQdq8D1mgo
To claim this, I am signing this object:
module.exports = (file, api, options) => { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
const createArrowFunctionExpression = fn => { | |
return j.arrowFunctionExpression( | |
fn.params, | |
fn.body, | |
false); |
module.exports = (file, api, options) => { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
const getBodyStatement = fn => { | |
if ( | |
fn.body.type == 'BlockStatement' && | |
fn.body.body.length == 1 | |
) { |
module.exports = (file, api, options) => { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
// We have to add "use strict" for node to play nice | |
// Taken from https://github.com/cpojer/js-codemod/blob/master/transforms/use-strict.js | |
const hasStrictMode = body => | |
body.some( | |
statement => j.match(statement, { | |
type: 'ExpressionStatement', |
export default function transformer(file, api) { | |
const j = api.jscodeshift; | |
const name = "subscribeToPlan"; | |
const newName = name; | |
const root = j(file.source); | |
root | |
.find(j.MethodDefinition) | |
.filter(path => !!path.value.key.name) |
I hereby claim:
To claim this, I am signing this object:
"use strict"; | |
const { Issuer, Strategy } = require("openid-client"); | |
Issuer.defaultHttpOptions = { timeout: 5000 }; | |
function createUser(userinfo) { | |
const name = userinfo.name.split(","); | |
return { | |
id: userinfo.uniqueuserid, |
function WebRtcSupportGate({ | |
children, | |
forceUnsupported, | |
forceUnsupportedIos, | |
forceUnsupportedFacebook, | |
forceUnsupportedInApp, | |
}) { | |
const isWebRtcSupported = | |
!!global.RTCPeerConnection && | |
!!global.navigator.mediaDevices && |
if ('mediaCapabilities' in navigator && 'encodingInfo' in navigator.mediaCapabilities) { | |
const videoFileConfiguration = { | |
type : 'record', | |
video : { | |
contentType: "video/webm;codecs=vp8", | |
width: 1920, | |
height: 1080, | |
bitrate: 2500000, | |
framerate: 30, | |
} |
const dgram = require('dgram'); | |
// STUN binding request | |
const bind = Buffer.from('000300002112a4425f73a4b270529f877091d580', 'hex'); | |
const socket = dgram.createSocket('udp4'); | |
socket.on('message', (data) => { | |
console.log('STUN BINDING RESPONSE', data.toString()); | |
}); |
src = "url_to_imgur" | |
img = new Image(); | |
img.crossOrigin = "Anonymous"; | |
img.addEventListener("load", analyze, false); | |
img.src = src; | |
function analyze() { | |
canvas = document.createElement("canvas") | |
ctx = canvas.getContext("2d") |