Skip to content

Instantly share code, notes, and snippets.

@MihaiTabara
MihaiTabara / tweepy_runner.py
Last active September 8, 2021 16:03
Script to download Twitter timeline for a user and store it to MongoDB
# script to download up to <= 3200 (the official API limit) of most recent tweets from a user's timeline
from pymongo import MongoClient
import tweepy
import json
#Twitter API credentials
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
@skeeto
skeeto / kenken.c
Last active November 8, 2021 16:36
KenKen generator
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <inttypes.h>
#include <time.h>
#include <getopt.h>
static uint64_t
xorshift(uint64_t *state)
{
@jeekajoo
jeekajoo / README.md
Last active February 18, 2022 17:31 — forked from JohnTroony/delete_all_tweets.py
delete ALL tweets using tweepy

Delete ALL tweets

Modifications

  • Remove confirmations
  • Add README

How to use

@olih
olih / jq-cheetsheet.md
Last active September 21, 2026 14:18
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@gaearon
gaearon / connect.js
Last active October 13, 2025 06:56
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@penguinpowernz
penguinpowernz / README.md
Last active September 23, 2026 10:13
WPA CLI commands
command args description
status [verbose] get current WPA/EAPOL/EAP status
ifname get current interface name
ping pings wpa_supplicant
relog re-open log-file (allow rolling logs)
note <text> add a note to wpa_supplicant debug log
mib get MIB variables (dot1x, dot11)
help [command] show usage help
interface [ifname] show interfaces/select interface
@tpae
tpae / Trie.js
Created November 20, 2016 23:49
Trie.js - super simple JavaScript implementation
// Trie.js - super simple JS implementation
// https://en.wikipedia.org/wiki/Trie
// -----------------------------------------
// we start with the TrieNode
function TrieNode(key) {
// the "key" value will be the character in sequence
this.key = key;
@jonchurch
jonchurch / glitch_vimify.js
Last active April 18, 2021 01:57
Vim Bindings for Glitch.com editor
// Load your Glitch project, paste this into the javascript console of chrome inspect
// Enjoy vim goodness!
(function () {
var makeCursorFat = function() {
var style = document.createElement('style');
style.textContent =
'div.CodeMirror div.CodeMirror-cursor { ' +
'width: auto; ' +
'border: 0; ' +

Get/set ID3 meta tags using ffmpeg

A quick guide on how to read/write/modify ID3 metadata tags for audio / media files using ffmpeg.

FFmpeg has a free-form command line option that allows the user to specify key-value-pairs for encoding metadata. Let's take a look.

1. Read ID3 metadata

To list all global metadata tags for a media file, just set an input but no output file.

@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!