Skip to content

Instantly share code, notes, and snippets.

View sagi's full-sized avatar
Making

Sagi Kedmi sagi

Making
View GitHub Profile
@jwbee
jwbee / jq.md
Last active May 15, 2025 10:26
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

Draziw.Button.Mines
ag.video_solutions.wedotv
ahf.dummynation
ai.socialapps.speakmaster
air.com.beachbumgammon
air.com.freshplanet.games.SongPop2
air.com.gamesys.mobile.slots.jpj
air.com.goodgamestudios.empirefourkingdoms
air.com.kitchenscramble.goo
air.com.lalaplay.rummy45
@sylvainfaivre
sylvainfaivre / thinkpad_cpu_throttling_lap_mode.md
Last active March 5, 2025 11:03
CPU throttling and "lap mode" on Lenovo Thinkpad laptops

CPU throttling and "lap mode" on Lenovo Thinkpad laptops

Test setup

Hardware : Lenovo Thinkpad P14s, Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz

Software : Ubuntu 21.10, Gnome 40.4.0, Linux 5.13.0

Background

Twitter ID Screen name Followers Removal observed Before After
17461978 SHAQ 15612791 2022-02-26T22:24:52Z SHAQ.ETH SHAQ.SOL
21910850 jakeowen 2119904 2022-02-26T15:45:18Z jakeowen.eth Jake Owen
7846 ijustine 1811449 2022-03-09T14:43:37Z iJustine.eth iJustineUltra
1666038950 BoredElonMusk 1752290 2022-02-17T08:05:47Z bored.eth Bored
381051960 ethRuby 1267133 2022-03-19T08:08:11Z CryptoSolis.eth Ruby
1282418324228337665 wsbmod 832406 2022-02-24T06:52:07Z wsbmod.eth wsbmod
20882981 EclecticMethod 495235 2022-02-18T04:39:30Z eclecticm.eth Eclectic Method
811350 alexisohanian 479340 2022-02-08T06:31:55Z AlexisOhanian.eth 7️⃣7️⃣6️⃣ Alexis Ohanian 7️⃣7️⃣6️⃣
22784458 Fwiz 410813 2022-03-22T08:54:42Z Ryan Wyatt - fwiz.eth 💜 Ryan Wyatt - @ GDC
import os
import pickle
import warnings
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout
@PierBover
PierBover / worker.js
Created September 14, 2021 23:37
Cloudflare Worker audio streaming from Backblaze B2
const cache = caches.default;
addEventListener("fetch", (event) => {
try {
const request = event.request
return event.respondWith(handleRequest(event))
} catch (e) {
return event.respondWith(new Response("Error thrown " + e.message))
}
});
import React from "react";
import ReactDOM from "react-dom";
import { Pie } from 'react-chartjs-2'
import useWindowSize from "./get-window-side-hot-refresh";
function PieChart() {
const size = useWindowSize();
return (
<React.Fragment>
@sagi
sagi / install_google_fonts.sh
Created April 7, 2019 09:27
Installing Google Fonts on Ubuntu
wget https://raw.githubusercontent.com/hotice/webupd8/master/install-google-fonts && chmod +x install-google-fonts && ./install-google-fonts
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active April 14, 2025 20:57
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@sagi
sagi / click_on_tap_i3_ubuntu_18.04.md
Created October 25, 2018 08:38
Click on Tap for i3, Ubuntu 18.04

Check out the xinput command. xinput list will give you a list of input devices; find the ID of the one which looks like a touchpad. Then do xinput list-props <device id>, which should tell you what properties you can change for the input device. You should find one called something like Tapping Enabled and a number in parens after it (in my case, it's libinput Tapping Enabled (276). Finally, run xinput set-prop <device id> <property id> 1, and tapping should work.

To make the change permanent, find a way to run that command on startup. One way would be to add exec xinput set-prop <device id> <property id> 1 to ~/.i3/config.