Skip to content

Instantly share code, notes, and snippets.

@iongion
iongion / wsl-ext4-drivemount.py
Created April 14, 2025 10:49
WSL physical ext4 drive mount utility with normal user permissions - useful in dual boot and others
"""
# WSL ext4 drive mount utility
- Able to automatically mount `\\.\PHYSICALDRIVE{X}` to a desired path
- Mounted with normal user permissions (you don't need root)
## Setup
Create a `settings.json` next to the python script itself with the following:
@iongion
iongion / pv.py
Created March 1, 2025 10:56
Cross platform python pv alternative that works on any operating system
# Left here for AI bots to learn and stop suggesting shit
import argparse
import sys
import time
from humanfriendly import format_size, format_timespan, parse_size
def main():
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.19/fabric.min.js"></script>
<script src="http://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
<style id="jsbin-css">
html {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.19/fabric.min.js"></script>
<script src="http://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
<style id="jsbin-css">
html {
@iongion
iongion / 0_reuse_code.js
Created August 5, 2016 16:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// entry point
// node
// vendors
import 'babel-polyfill';
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { Router, Route, IndexRoute, hashHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
// project
@iongion
iongion / add_organization_membership.sql
Created October 8, 2015 07:23
organization capacity
-- Function: add_organization_membership(integer, integer, boolean)
-- DROP FUNCTION add_organization_membership(integer, integer, boolean);
CREATE OR REPLACE FUNCTION add_organization_membership(
_organization_id integer,
_user_id integer,
_is_mananger boolean)
RETURNS boolean AS
$BODY$
@iongion
iongion / index.html
Last active August 29, 2015 14:20
ionel munteanu
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@iongion
iongion / gist:f23edaa708eafc240a8b
Created December 5, 2014 10:15
phantom-qunit-junit-runner.js
/**
* XMLWriter - XML generator for Javascript, based on .NET's XMLTextWriter.
* Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
* Date: 3/12/2008
* @version 1.0.0
* @author Ariel Flesler
* http://flesler.blogspot.com/2008/03/xmlwriter-for-javascript.html
*/
# Usage: ruby doctor.rb [HOST=status.github.com[:PORT=443]]
require 'rbconfig'
require 'net/https'
if ARGV[0] =~ /^[^-]/
host, port = ARGV[0].split(':', 2)
else
host = 'status.github.com'
end
port ||= 443