Skip to content

Instantly share code, notes, and snippets.

View gpollo's full-sized avatar

Gabriel Guilbert gpollo

View GitHub Profile
@gpollo
gpollo / leptos-vue-transition.rs
Created May 21, 2024 01:10
Leptos component that replicates Vue's <Transition>
use std::cell::{Cell, RefCell};
use std::ops::Deref;
use std::rc::Rc;
use leptos::leptos_dom::helpers::AnimationFrameRequestHandle;
use leptos::*;
use web_sys::EventTarget;
/// Possible states of the transition.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
@gpollo
gpollo / README.md
Last active September 2, 2021 02:55
Cross-compiling applications for Archlinux ARM

Archlinux ARM Cross-Compiling

This document assumes that the host system is running Archlinux.

Host Requirements

On your machine, you need binfmt and qemu static for the target architecture. You can install these packages:

  • binfmt-qemu-static-all-arch
  • qemu-user-static-bin
#!/usr/bin/env python
import fbchat
import time
import qng.generator
username = "<redacted>"
password = "<redacted>"
thread_id = "<redacted>"
@gpollo
gpollo / jp.py
Created February 25, 2020 17:11
#!/usr/bin/env python3
import mechanize
import bs4
import re
import random
browser = mechanize.Browser()
browser.set_handle_robots(False)
browser.set_handle_redirect(True)
image: trion/ng-cli-karma
stages:
- lint
- build
- test
cache:
paths:
- client/node_modules
@gpollo
gpollo / votestrawpoll.py
Created January 8, 2018 17:17
Small python script that automatically vote on Strawpoll using different proxies
#!/usr/bin/env python2
#
# Usage: <executable> <url> <choice> <list>
#
# The `url` is the url of the poll. It won't work if "Improve spam prevention"
# is activated. The `choice` is the index of the answer your want to spam. The
# `list` is the list containing the proxies.
#
import re
@gpollo
gpollo / xilinxget.py
Created December 10, 2017 18:01
Download files from Xilinx webserver
#!/usr/bin/env python2
#
# Usage: <executable> <link>
#
# Example: https://asciinema.org/a/cwLDNFVAwVe7lmOtSEQS6YCuU
#
# Note: You need to setup your login informations. You can customize the
# informations that is fill in the download form below.
import re
#!/bin/bash
if [[ -f "concatenate.raw" ]]; then
rm "concatenate.raw"
fi
find ./ -type f -iname "*.flac" | sort | while read FILE; do
printf "$FILE\n"
ffmpeg -y -i "$FILE" -f s16le -acodec pcm_s16le - >> "concatenate.raw" 2> log < /dev/null
#!/usr/bin/bash
wget "http://www.polymtl.ca/sc/logos_normes/logo.php" 2> /dev/null
mkdir -p eps svg tex
cd eps
cat ../logo.php | grep -Po '(?<=href=")[^"]*' | grep -i eps | cut -c 4- | while read EXT; do
if [[ $(echo "$EXT" | grep bloc) ]]; then
continue
#!/bin/bash
# Do not specify a $DUP_NAME with a space.
DUP_NAME=Duplicate
DUP_DIR="$(pwd)/$DUP_NAME"
function enter_subfolder {
DIR=$(find ./ -maxdepth 1 -type d)
COUNT=$(echo "$DIR" | wc -l)