Skip to content

Instantly share code, notes, and snippets.

View wenxingxing's full-sized avatar
:fishsticks:

wenxing wenxingxing

:fishsticks:
View GitHub Profile
@wenxingxing
wenxingxing / runtime_expanded.rs
Last active October 21, 2022 13:35
expand runtime/src/lib.rs
#![feature(prelude_import)]
#![recursion_limit = "256"]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;
pub use frame_support::{
construct_runtime, parameter_types,
traits::{
ConstU128, ConstU32, ConstU64, ConstU8, KeyOwnerProofSystem, Randomness, StorageInfo,
int foo(char* x, char*, int a, int b) { return a + b; }
typedef int (*func)(int, int);
int main() {
int a = 10, b = 20, c = 0;
void* p = (void*)foo;
__asm__ __volatile__(
"movl %%edx,%%esi; "
@wenxingxing
wenxingxing / TurnipPrices.cpp
Created April 24, 2020 02:52 — forked from Treeki/TurnipPrices.cpp
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
$ sudo pacman -S ibus ibus-rime
$ sudo pacman -S ttf-dejavu adobe-source-han-sans-otc-fonts
$ cat .xinitrc
...
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export XMODIFIERS="@im=ibus"
...
$ sudo reboot
set -g default-terminal screen-256color
set-option -g mouse on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
@wenxingxing
wenxingxing / ipython-notebook-multiple-kernels-venv.md
Created March 24, 2018 15:36 — forked from victorkristof/ipython-notebook-multiple-kernels-venv.md
IPython Notebook with multiple kernels and virtualenv

IPython Notebook with multiple kernels and virtualenv

Explanations of how to install and use IPython Notebook with a venv and multiple virtualenv (one for Python 2 and one for Python 3).

Step-by-step installation

We run step-by-step and detail all the operations. A quicker, more concise guide can be found at the end of this gist.

Create virtualenv

We create first one venv for each version of Python.

mkvirtualenv -p /path/to/python2.7 venv-name
deactivate