Skip to content

Instantly share code, notes, and snippets.

View nic's full-sized avatar
✔️
‌‌

nic

✔️
‌‌
View GitHub Profile
@nic
nic / git-repo-mirror.md
Created March 6, 2019 06:37
Mirroring a repo from BitBucket (or Gitlab) to Github
  1. Create an empty repo in Github
  2. git clone --bare git@bitbucket.org:user/repo.git
  3. cd repo.git
  4. git push --mirror git@github.com:user/repo.git
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const Readable = require('readable-stream').Readable;
function complements(arr, predicate) {
const out = [[],[]];
arr.forEach(e => out[Number(!!predicate(e))].push(e));
return out;
#!/bin/bash
if [ -z "$1" ]; then
echo -e "Usage:\n $0 address\n\nEx: $0 google.com"
exit 0
fi
for ip in `nslookup $1 |grep Address|grep -v 53 |cut -d":" -f2|cut -d' ' -f2`; do
echo "$ip -> $(ping -c 1 "$ip" | grep time |cut -d'=' -f4)";
done
@nic
nic / setup_relay.js
Last active December 15, 2017 13:12
create-react-app + Relay Modern without Eject
#!/usr/bin/env node
// by nic - 2017
// It's 10 lines of code to prevent you to call 'yarn eject'
// Just call this script before start/build as in this example: https://github.com/nic/relay/blob/master/package.json#L23-L24
const fs = require('fs'),
file = require('path').resolve('./node_modules/babel-preset-react-app/index.js'),
texts = fs.readFileSync(file, 'utf8'),
plugin = 'babel-plugin-relay',
pattern = 'const plugins = [';

Keybase proof

I hereby claim:

  • I am nic on github.
  • I am upnic (https://keybase.io/upnic) on keybase.
  • I have a public key ASC5pwdB_-h8PvZaGxDv7HyUMguyoT87JT9tSj98UdkcRgo

To claim this, I am signing this object: