Skip to content

Instantly share code, notes, and snippets.

@jasonwarta
jasonwarta / migrate-git-repo.sh
Last active January 6, 2019 03:10
script for migrating a git repo between services
# put this function in some file that will be loaded into your bash profile
# I personally use a dedicated sourced file for functions but it could also be placed
# in your .bashrc, .profile, or .bash_profile
# Usage:
# at a bash prompt, run
# migrate-repo <repo-url>
# the repo url could look like git@github.com:username/repo-name.git
function migrate-repo() {
new_repo_url=$1
@shelldandy
shelldandy / App.js
Created October 17, 2017 19:08
nprogress with react-router in create-react-app
import React from 'react'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import routes from './routes'
import FancyRoute from './components/tools/FancyRoute'
const App = props =>
<Router>
<Switch>
{routes.map((route, i) =>
<FancyRoute key={i} {...route} />
@mdonkers
mdonkers / server.py
Last active April 25, 2024 10:25
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1