Skip to content

Instantly share code, notes, and snippets.

@Tewr
Tewr / MessageBoxWithCheckBox.Designer.cs
Last active November 18, 2021 18:27
Winforms MessageBoxWithCheckBox
namespace CustomMessageBoxes
{
partial class MessageBoxWithCheckBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
@DesignByOnyx
DesignByOnyx / README.md
Last active June 25, 2024 16:30
A script for setting up a project to use semantic-ui-less

This script was inspired by this blog post - however I found the technique to be a little insufficient. Many thanks to Artem Butusov as I would not have been able to do this without his blog post.

This script is intended to be used with semantic-ui-react projects. If you are just using semantic-ui, then you may need to do some other troubleshooting... I don't know as I haven't tested. From what I can tell everything should work just fine.

Before we get started

This process is completely different from the one described in the blog post above. This script is intended to do everything for you - no manual copying or updating code is required. If you have already followed

@georgexsh
georgexsh / goto.py
Created September 18, 2017 07:47
python goto with system trace function
import sys
def j(lineno):
frame = sys._getframe().f_back
called_from = frame
def hook(frame, event, arg):
if event == 'line' and frame == called_from:
try:
frame.f_lineno = lineno

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

def multipart_encoder(params, files):
boundry = uuid.uuid4().hex
lines = list()
for key, val in params.items():
if val is None: continue
lines.append('--' + boundry)
lines.append('Content-Disposition: form-data; name="%s"'%key)
lines.extend([ '', val ])
for key, uri in files.items():
@Saissaken
Saissaken / Update git fork with tags.sh
Last active May 14, 2025 10:18
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@mihow
mihow / load_dotenv.sh
Last active April 25, 2025 17:10
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@haxiomic
haxiomic / Partial.hx
Last active February 26, 2023 11:44
Haxe macro to make all fields of a type optional (similar to Typescript's Partial<T>)
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.TypeTools;
#if !macro
@:genericBuild(PartialMacro.build())
#end
class Partial<T> {}
class PartialMacro {
import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
import throttle from 'lodash/throttle'
import { INTERVAL } from './constants.js'
let bound // are the event handlers bound?
let current // current scroll position, from top of document
let queue // array of React Components to check