Skip to content

Instantly share code, notes, and snippets.

View akiross's full-sized avatar
🥷
Ninja

Alessandro Re akiross

🥷
Ninja
View GitHub Profile

For all of you wanting this feature there's a great option out there if you're willing to step beyond Signal: Conversations. There's no primary/secondary distinction: it does true-multi-device multi-key encryption (they adopted libsignal and built on it and I'm very grateful that OWS developed and released it so it could be built upon), as well as video chat, file attachments (encrypted, of course), and cross-device history syncing, and all that at 1/3rd the size of Signal, and without a dependency on push notifications. And you can pretty easily set up alt identities and use them on the same devices so there's no need to worry about [giving out a private number](https://www.vice.com/en_us/article/9kaxge/how-to-use-signal-without-giving-out-your-phone-number-a-gender

@moorepants
moorepants / chaos_pendulum_pythreejs_manual.ipynb
Created November 24, 2019 16:09
Example of how to manually use pythreejs to animate a PyDy scene.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Okay, I've got a need to build Firefox from source, and I'd like to do that on a remote machine, and then copy build result back to my laptop. With Nix, using bastion host. I'll note details of my successful adventure.

Setup & Sources of knowledge

Here's the list of resources I've used actively:

Here's my setup:

@Matthias247
Matthias247 / async_await_cancellation.md
Created May 28, 2019 06:09
Async/Await - The challenges besides syntax - Cancellation

Async/Await - The challenges besides syntax - Cancellation

This is the second article in a series of articles around Rusts new async/await feature. The first article about interfaces can be found here.

In this part of the series we want to a look at a mechanism which behaves very different in Rust than in all other languages which feature async/await support. This mechanism is Cancellation.

from line_profiler import LineProfiler
def do_profile(follow=[]):
def inner(func):
def profiled_func(*args, **kwargs):
try:
profiler = LineProfiler()
profiler.add_function(func)
for f in follow:
profiler.add_function(f)
@jstnlvns
jstnlvns / git: gitignore.md
Created November 16, 2018 19:42
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files

Nix Flake MVP

Goals

  • To provide Nix repositories with an easy and standard way to reference other Nix repositories.

  • To allow such references to be queried and updated automatically.

  • To provide a replacement for nix-channel, NIX_PATH and Hydra

@dideler
dideler / bot.rb
Last active May 8, 2026 10:36
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
def train_network(samples, neural_network, nr_epochs=10, batch_size=64):
optimizer = optim.Adam(neural_network.parameters())
neural_network.train()
for epoch_nr in range(nr_epochs):
sample_ids = np.random.shuffle(range(len(samples)))
for start in range(0, len(samples) // batch_size, batch_size):
mini_batch = samples[sample_ids[start: start + batch_size]]
boards, pis, vs = zip(*mini_batch)
@manuel-delverme
manuel-delverme / zero.py
Last active June 11, 2018 14:31
zero code
environment = environments.GoEnvironment(board_size=19)
player_mcts = mcts.MCTS(
environment,
networks.NeuralNetwork(board_size=environment.getStateSize(), action_size=environment.getActionSize()),
)
training_samples = collections.deque(maxlen=opt.training_samples_buffer_size)
for iteration_number in range(opt.num_iters):