Skip to content

Instantly share code, notes, and snippets.

@wontoncc
wontoncc / balloontip.py
Last active March 1, 2024 15:47
Balloon tip module, Python, using win32gui.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip:
@atenni
atenni / README.md
Last active April 24, 2024 01:36
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@KhepryQuixote
KhepryQuixote / PyTorStemPrivoxy.md
Last active September 9, 2023 20:36
Python script to connect to Tor via Stem and Privoxy, requesting a new connection (hence a new IP as well) as desired.

Crawling Anonymously with Tor in Python

adapted from the article "Crawling anonymously with Tor in Python" by S. Acharya, Nov 2, 2013.

The most common use-case is to be able to hide one's identity using TOR or being able to change identities programmatically, for example when you are crawling a website like Google and you don’t want to be rate-limited or blocked via IP address.

Tor

Install Tor.

@nderkach
nderkach / read_mitmproxy_dumpfile.py
Last active April 18, 2023 21:36
Read a mitmproxy dump file and generate a curl command
#!/usr/bin/env python
#
# Simple script showing how to read a mitmproxy dump file
#
### UPD: this feature is now avaiable in mitmproxy: https://github.com/mitmproxy/mitmproxy/pull/619
from libmproxy import flow
import json, sys
@WillemRB
WillemRB / ProcessingAnimation
Last active December 15, 2023 01:28
PowerShell function to create a processing animation for long running scriptblocks.
function ProcessingAnimation($scriptBlock) {
$cursorTop = [Console]::CursorTop
try {
[Console]::CursorVisible = $false
$counter = 0
$frames = '|', '/', '-', '\'
$jobName = Start-Job -ScriptBlock $scriptBlock
@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@airstrike
airstrike / mute-mic.ahk
Last active December 29, 2023 22:08
AutoHotkey | Toggle microphone hotkey script (Windows+U)
;
; AutoHotkey Version: v1.1.22.06
; Language: English
; Platform: Windows 10
; Author: Andy Terra <github.com/airstrike>
;
; Script Function:
; Toggle Microphone Mute -- assumes it is located at WAVE:1, device #2
; Use the SoundCardAnalysis script to figure out where your mic is
; https://www.autohotkey.com/docs/commands/SoundSet.htm#Ex
@brettz9
brettz9 / styles.less
Last active April 26, 2023 21:06
Atom stylesheet
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@karmankertesz
karmankertesz / disqus-delete.js
Created September 30, 2016 23:11
Console commands to delete Disqus comments
/*
These are Javascript console commands to delete your public Disqus comments to protect your privacy.
Keep in mind:
"Comments are not anonymized when they are deleted and can still be seen by moderators."
https://help.disqus.com/customer/portal/articles/466229
Open your profile page:
https://disqus.com/by/<username>/comments/
@raineorshine
raineorshine / memrise-export.js
Last active December 1, 2021 17:02
Export Memrise course words to CSV. There is also a Chrome Extension: https://chrome.google.com/webstore/detail/memrise-export/hcllgkpmoiolndnhmbdceffaidjmkoam
/*
UPDATE: This is now a Chrome Extension: https://chrome.google.com/webstore/detail/memrise-export/hcllgkpmoiolndnhmbdceffaidjmkoam
Source Code: https://github.com/raineorshine/memrise-export
Export Memrise course words to CSV (technically TSV, or "tab separated file", but it is effectively the same).
1. Log into Memrise.
2. Navigate to the course page you would like to export (e.g. https://app.memrise.com/course/2156672/german-random-01/).
3. Open the browser's Developer Console (https://support.airtable.com/hc/en-us/articles/232313848-How-to-open-the-developer-console)