Skip to content

Instantly share code, notes, and snippets.

Avatar
🥔
Sniffing potatoes

Gary LameLemon

🥔
Sniffing potatoes
View GitHub Profile
@LameLemon
LameLemon / dht11_esp32_wot.ino
Created Jun 2, 2020
Setup ESP32 as Web of Things device to record temperature and humidity using the DHT11
View dht11_esp32_wot.ino
#define LARGE_JSON_BUFFERS 1
#define ARDUINOJSON_USE_LONG_LONG 1
#include <Arduino.h>
#include "Thing.h"
#include "WebThingAdapter.h"
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
View zshrc
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@LameLemon
LameLemon / giffer.sh
Created Jun 24, 2019
Bash script to make a gif from a section of a video using ffmpeg
View giffer.sh
#!/bin/bash
scale=640
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]
then
echo "Arugments <start time> <duration> <file>"
fi
ffmpeg -ss "$1" -t "$2" -y -i "$3" -vf fps=24,scale="$scale":-1:flags=lanczos,palettegen palette.png
@LameLemon
LameLemon / webm.md
Created Jun 23, 2019 — forked from ndarville/webm.md
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767
View webm.md

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.
@LameLemon
LameLemon / stars.py
Last active Oct 13, 2020
Save all GitHub user stars to JSON
View stars.py
from time import sleep
from urllib.request import urlopen, Request, urlretrieve
import requests
from bs4 import BeautifulSoup as soup
import re
import sys
import json
stars_list = []
count = 0
@LameLemon
LameLemon / linfoxdomain-scraper.py
Created May 20, 2019
Downloads all flash games from linfoxdomain.com
View linfoxdomain-scraper.py
from time import sleep
from urllib.request import urlopen
from urllib.request import Request
from urllib.request import urlretrieve
import requests
from bs4 import BeautifulSoup as soup
import os
def scrape(category, down_path):
if not os.path.exists(down_path):
@LameLemon
LameLemon / http_server.c
Last active Jun 10, 2018
A simple HTTP Server in C
View http_server.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
int main() {
// Char array to hold html file text