Skip to content

Instantly share code, notes, and snippets.

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
@andrebrait
andrebrait / keychron_linux.md
Last active July 26, 2024 15:40
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@rhowardiv
rhowardiv / dd-log-export.bash
Created August 5, 2019 13:32
Datadog log export -- approach not viable due to rate limit (300 reqs/h)
#!/bin/bash
set -e
if [[ -z "$DD_APP_KEY" ]]; then
echo "I expect the Datadog app key in DD_APP_KEY"
exit
fi
if [[ -z "$DD_API_KEY" ]]; then
echo "I expect the Datadog API key in DD_API_KEY"
exit
@michelbl
michelbl / python_private_dep.md
Last active October 25, 2021 04:04
Python private dependencies cheatsheet

I need to give access to a private dependency. It can happen for continuous integration or deployment.

Here we use python and github, using the services CircleCI and Heroku. However, the principles applies everywhere.

What is a deploy key?

See https://developer.github.com/v3/guides/managing-deploy-keys/

There are 4 ways of granting access to a private dependency, but deploy keys are a good compromise in term of security and ease of use for projects that do not require too many dependencies (in that case, prefer a machine user). In any case, do not use username/password of a developer account or oauth token as they do not provide privilege limitation.

@takegue
takegue / git-sparse-checkout-for-circleci.sh
Last active February 14, 2020 10:54 — forked from sumardi/gist:5559896
Subdirectory checkouts with Git sparse-checkout
#!/bin/bash -e
CIRCLE_WORKING_DIRECTORY="${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}"
[[ ! -d $CIRCLE_WORKING_DIRECTORY ]] && mkdir -p $CIRCLE_WORKING_DIRECTORY
cd $CIRCLE_WORKING_DIRECTORY
git init
git remote add origin $CIRCLE_REPOSITORY_URL
git config core.sparsecheckout true
@schmich
schmich / ducky.md
Last active July 10, 2024 10:25
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2 Skyline

To use media keys on the Ducky One 2 Skyline, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.

Example

Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

@27Bslash6
27Bslash6 / gcrgc.sh
Last active September 6, 2020 07:55 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@Prajjwal
Prajjwal / ephemeral-file-sharing-services.md
Last active May 26, 2024 10:11
A List of Ephemeral File Sharing Services

A List of Ephemeral File Sharing Services

Contributions welcome.

~ Prajjwal Singh

Service CLI? Max Size Direct Access Files Expire? Can Limit Download Count? Password Protection HTTPS
c-v.sh curl -F 4 GB Yes Yes, by Mister Alg. No No Enforced
FileIO Yes 5 GB Yes Optionally Fixed @ 1 No Yes