Skip to content

Instantly share code, notes, and snippets.

View clouedoc's full-sized avatar
๐Ÿฆ€
Learning Rust for fun&profit

Camille Louรฉdoc-Eyriรจs clouedoc

๐Ÿฆ€
Learning Rust for fun&profit
View GitHub Profile
@barneycarroll
barneycarroll / unfuckReact.js
Last active September 2, 2022 14:37
React components are so fucking stupid, it's unbelievable. 3 months with this library version 15 and the glaring stupidity of the API just keeps coming in waves. Fixing some of this stuff โ€“ just for the sake of internal consistency โ€“ would have been so simple. The number of hoops you're required to jump through for trivial shit. Ugh.
const mounted = new WeakSet()
export default (component, displayName = component.displayName || component.name || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
constructor(){
this.state = {}
component.apply(this, arguments)
}
@dchrostowski
dchrostowski / scrapy_socks.md
Created June 13, 2017 05:29
socks proxy middleware example for scrapy with DeleGate

I thought I'd just share how I'm getting socks support with scrapy. Basically there are two pretty good options, DeleGate and Privoxy. I'm going to give an example of a middleware that I implemented using DeleGate which has worked great for me thus far.

DeleGate is amazingly simple and straightforward; it's basically serving as an http-to-socks bridge. In other words, you make a request to it with scrapy as if it were an http proxy and it will take care of bridging that over to the socks server. Privoxy can do this too, but it seems like DeleGate has much better documentation and possibly more functionality than Privoxy (maybe...) You can either build from source or download a pre-built binary (supports Windows, MacOS X, Linux, BSD, and Solaris). Set it up however you like so that it's on your PATH. In my Ubuntu setup I simply created a symbolic link to the binary in my /usr/bin directory. Copying it over there works too. So after it'

@IMcPwn
IMcPwn / delete-all-messages.js
Last active April 10, 2025 03:36 — forked from niahoo/delete-all-messages.js
Delete all messages in a Discord channel
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom)
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right.
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID.
// Copy / paste the below script into the JavaScript console.
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages).
var before = 'LAST_MESSAGE_ID';
clearMessages = function(){
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, "");
const channel = window.location.href.split('/').pop();
@alopresto
alopresto / gpg_git_signing.md
Last active December 8, 2024 15:44
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@miguelmota
miguelmota / server.js
Created November 16, 2015 00:32
Generate text overlaying an image with Node.js and imagemagick.
// @credit: from someone on the internet
http = require('http')
https = require('https')
fs = require('fs')
url = require('url')
req = require('request')
server = require('express')();
im = require('imagemagick')
@FlorianWolters
FlorianWolters / cpp-source_code_snippets.md
Last active February 20, 2025 13:30
C++ source code snippets

C++ source code snippets

Represent one byte

using Byte = std::uint8_t;

Represent a dynamic number of bytes

#include <vector>
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@bullshit
bullshit / Install Docker on Raspberry Pi (Arch Linux).md
Created April 11, 2014 21:22
Install Docker on Raspberry Pi (Arch Linux)

Install Docker on Raspberry Pi (Arch Linux)

Prepare SD Card

  1. Download Image
  2. Unzip Image
  3. Copy Image on SD Card (dd if=./ArchLinuxARM-2014.03-rpi.img of=/dev/disk2)
  4. Boot Raspberry Pi

Connect to Pi

  1. Find out IP
@rxaviers
rxaviers / gist:7360908
Last active May 16, 2025 22:40
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@revolunet
revolunet / countries-FR.json
Last active July 22, 2024 13:18
Liste des pays en FR
{
"AF": "Afghanistan",
"ZA": "Afrique du Sud",
"AL": "Albanie",
"DZ": "Algรฉrie",
"DE": "Allemagne",
"AD": "Andorre",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctique",