Skip to content

Instantly share code, notes, and snippets.

@anurupr
anurupr / benchmark_cygwin_mirrors.bat
Created November 2, 2021 23:13 — forked from kou1okada/benchmark_cygwin_mirrors.bat
Benchmark cygwin mirrors.
@ECHO OFF
ECHO Benchmark cygwin mirrors.
powershell -Command ^
"^
$len = 0;^
$min = 1e9;^
$best = """nothing""";^
Import-Module BitsTransfer;^
Start-BitsTransfer https://cygwin.com/mirrors.lst;^
foreach($mirror in Get-Content mirrors.lst) {^
@TheCrazyMax
TheCrazyMax / youtube.lua
Last active February 12, 2025 16:26
Vlc youtube single video or playlist
--[[
$Id$
Copyright © 2007-2018 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
@just4give
just4give / keepalive_ngrok.py
Last active January 30, 2022 23:18
ngrok forever on raspberry pi
import json
import subprocess
import time
from pathlib import Path
import atexit
import boto3
import requests
import datetime
#path where you have extracted ngrok execution file. Follow readme file to install on Pi
@MrThiago
MrThiago / adb-get-serialno
Created April 30, 2018 10:15
How to get Android device Serial Number Via ADB
adb shell getprop | grep ro.boot.serialno
@yzhong52
yzhong52 / gist:f81e929e5810271292bd08856e2f4512
Last active June 18, 2022 13:53
Create Spark DataFrame From List[Any]
// Spark 2.1
val spark = SparkSession.builder().master("local").getOrCreate()
// Given a list of mixture of strings in integers
val values = List("20030100013280", 1.0)
// Create `Row` from `Seq`
val row = Row.fromSeq(values)
// Create `RDD` from `Row`
@jpierson
jpierson / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git
@unbug
unbug / Middleware.js
Last active January 6, 2024 04:17
Powerful Javascript Middleware Pattern Implementation, apply middleweares to any object. https://unbug.github.io/js-middleware/
'use strict';
/* eslint-disable consistent-this */
let middlewareManagerHash = [];
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
@level323
level323 / altnetworking.sh
Created August 3, 2016 21:14
Run a command inside a customised networking environment (using cgroups)
#!/bin/bash
# === INFO ===
# altnetworking.sh
# Description: Run the specified application in a custom networking environment.
# Uses cgroups to run process(es) in a network environment of your own choosing (within limits!)
VERSION="0.1.0"
# Author: John Clark
# Requirements: Debian 8 Jessie (plus iptables 1.6 from unstable)
#
@darrenscerri
darrenscerri / Middleware.js
Last active July 11, 2023 02:59
A very minimal Javascript (ES5 & ES6) Middleware Pattern Implementation
var Middleware = function() {};
Middleware.prototype.use = function(fn) {
var self = this;
this.go = (function(stack) {
return function(next) {
stack.call(self, function() {
fn.call(self, next.bind(self));
});
@kou1okada
kou1okada / benchmark_cygwin_mirrors.bat
Last active November 2, 2021 23:13
Benchmark cygwin mirrors.
@ECHO OFF
ECHO Benchmark cygwin mirrors.
powershell -Command ^
"^
$len = 0;^
$min = 1e9;^
$best = """nothing""";^
Import-Module BitsTransfer;^
Start-BitsTransfer https://cygwin.com/mirrors.lst;^
foreach($mirror in Get-Content mirrors.lst) {^