Skip to content

Instantly share code, notes, and snippets.

View keepitterron's full-sized avatar

Claudio Semeraro keepitterron

View GitHub Profile
// yarn install -D jscodeshift
module.exports = function(fileInfo, { jscodeshift: j }) {
const ast = j(fileInfo.source);
ast // import * as Sentry from 'sentry'
.find(j.ImportDeclaration, isSentryImport)
.replaceWith(nodePath => {
// get the underlying Node
const { node } = nodePath;
@keepitterron
keepitterron / missingLetter.js
Created March 20, 2020 10:06
Find the missing letter in range
const strings = ['abcd', 'cdefg', 'pqrs', 'abde'];
const missingLetter = string => {
return [...string]
.map(ltr => ltr.charCodeAt())
.map((code, index, all) => {
const prev = all[index - 1];
const expected = code - 1;
if (prev && prev !== expected) {
{
"ie": {
"6": 0.0001729030514402072,
"7": 0.006882439644990066,
"8": 0.0027754307997415076,
"9": 0.0037005743996553434,
"10": 0.0031841107395092698,
"11": 0.8557039380601091,
"5.5": 0
},

Keybase proof

I hereby claim:

  • I am keepitterron on github.
  • I am keepitterron (https://keybase.io/keepitterron) on keybase.
  • I have a public key ASDCDNI8Fy3XVnBNcZJemziavykSyJaGo8S87mW0iuzAggo

To claim this, I am signing this object:

@keepitterron
keepitterron / highlight_file.php
Created May 30, 2011 12:22
Highlight code in file if called directly
<?php
if (strpos(__FILE__,$_SERVER['PHP_SELF'])) {
highlight_file(__FILE__);die();
}
?>