Skip to content

Instantly share code, notes, and snippets.

View ptisserand's full-sized avatar
💭
Learning Rust

ptisserand

💭
Learning Rust
View GitHub Profile
@tdelabro
tdelabro / no_std-guide.md
Last active April 5, 2024 22:19
How to easely port a crate to `no_std`?

What is Rust's standard library?

One of the Rust programming language promises is "zero-cost abstraction". Therefore the language itself is pretty conservative about what it incorporates. Types that are basics in other languages, such as string, or features, such as async, cannot be part of the language itself because they are costly abstractions. The user may not need them at all, or he may prefer other alternative implementations. To make those types and functions available nonetheless, they are available as part of the Rust standard library, known as std. Part of this library, known as the prelude is imported by default in each .rs file so you don't have to repeat yourself too much.

Why would you want a no_std version of your crate?

Most of the time having this standard library available is not a problem because you run your code on a pretty standard environment: your own computer or a Linux server somewhere in the cloud. However, somet

@ponceto
ponceto / README.md
Last active August 18, 2023 16:53
Matrix characterfall on your terminal

Matrix characterfall effect

Abstract

These scripts are written to simulate the matrix characterfall on your terminal.

ASCII version

This is a version with a pure ascii charset of the matrix effect.

@hesido
hesido / coingecko.js
Last active November 13, 2023 23:15
Coingecko Add On for Google Spreadsheets
/**
* Returns Market Value From Coingecko api
* Function accepts ranges as well, please use it to reduce server lookups, so it fetches data only once.
* Update: 17.02.2020
*
* @param {string} symbol pair (required)
* @param {string} Default Value Missing Data (optional)
* @return {number} ticker price
* @customfunction
**/
@zhy0
zhy0 / ubuntu-cli-install-android-sdk.sh
Last active February 3, 2024 08:19
Install Android SDK on headless Ubuntu linux machine via command line, so that you can compile open source Android apps.
#!/bin/bash
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make # NDK stuff
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@kosiara
kosiara / setup_howto.txt
Last active April 21, 2017 03:42
Setup Facebook React-native sample (empty) project on Ubuntu
# author:
# @Bartosz Kosarzycki
#
sudo apt-get install npm
sudo npm install -g react-native-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /home/user/your/project/path
react-native init AwesomeProject
cd AwesomeProject
@MatejLach
MatejLach / razer-bwu13-macro.py
Created December 20, 2013 12:36
Razer BlackWidow keyboard - enable macro keys on Linux - updated for the 2013 Ultimate version.
#!/usr/bin/env python2
# blackwidow_enable.py
#
# Enables the M1-5 and FN keys to send scancodes on the Razer BlackWidow
# and BlackWidow Ultimate keyboards.
#
# You can use 'xev' and 'xbindkeys' to assign actions to the macro keys.
#
# Requires the PyUSB library.