Skip to content

Instantly share code, notes, and snippets.

View nkbt's full-sized avatar
💚

Nikita Butenko nkbt

💚
View GitHub Profile
@wknapik
wknapik / empty_bucket.sh
Last active March 5, 2024 09:53
Empty an s3 bucket of all object versions and delete markers in batches of 400
#!/usr/bin/env bash
set -eEo pipefail
shopt -s inherit_errexit >/dev/null 2>&1 || true
if [[ ! "$#" -eq 2 || "$1" != --bucket ]]; then
echo -e "USAGE: $(basename "$0") --bucket <bucket>"
exit 2
fi
const os = require("os");
const fs = require("fs");
const Emitter = require('events');
var wslNetworkInterfaces = function() {
console.log("WSL has no idea what interfaces are available.");
return {
"Loopback Pseudo-Interface 1": [
{
"address": "::1",
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 15, 2024 18:24
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
[push]
default = current
[user]
email = nik@butenko.me
name = Nik Butenko
[core]
autocrlf = input
excludesfile = /Users/nkbt/.gitignore
ignorecase = true
[alias]
.button {
margin-left: 10px;
}
.button:first-child {
margin-left: 0;
}
@seanadkinson
seanadkinson / example-route.js
Last active July 10, 2017 03:49
Merging react-router with react-proxy-loader to load bundles on page change
<Router.Route path="/home" handler={require('react-router-proxy!./Home.jsx')}/>
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@sudodoki
sudodoki / gulpfile.js
Created December 14, 2014 18:20
Adds a list of files in resulting concatenated file
var gulp = require('gulp');
var concat = require('gulp-concat-util');
var through = require('through');
var gutil = require('gulp-util');
var refObj = {wallOfText: ''};
function write(file) {
refObj.wallOfText += "/* " + file.path + " */" + gutil.linefeed;
this.emit('data', file);
}
@mathisonian
mathisonian / index.md
Last active March 22, 2023 05:31
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

gulp = require 'gulp'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
connect = require 'gulp-connect'
cached = require 'gulp-cached'
clean = require 'gulp-clean'
rjs = require 'gulp-requirejs'
karma = require('karma').server
karmaRunner = require('karma').runner
requirejs = require 'requirejs'