This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
set background=dark | |
set encoding=utf-8 | |
scriptencoding utf-8 | |
call plug#begin('~/.vim/plugged') | |
Plug 'mileszs/ack.vim' | |
Plug 'sjl/badwolf' | |
Plug 'vim-scripts/camelcasemotion' | |
Plug 'ctrlpvim/ctrlp.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Default)] | |
pub struct ParticleSystem { | |
to_spawn: Vec<(Particle, Transform, LocalToWorld, Velocity, Render, Flags)>, | |
to_despawn: Vec<Entity>, | |
} | |
impl ParticleSystem { | |
pub fn run(&mut self, world: &mut World, resources: &mut Resources) { | |
let dt = resources.frame_time; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn encode(data: &[u8]) -> Vec<u8> { | |
Encoder::new(data).encode() | |
} | |
pub fn decode(data: &[u8]) -> Vec<u8> { | |
Decoder::new(data).decode() | |
} | |
const ILLEGALS: [u8; 6] = [0, 10, 13, 34, 38, 92]; | |
const SHORT_MARK: u8 = 0b111; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::str; | |
fn main() { | |
let b = "67e5504410b1426f9247bb680e5fe0c8"; | |
let mut bytes = [0u8; 16]; | |
for (dest, chunk) in bytes.iter_mut().zip(b.as_bytes().chunks(2)) { | |
let s = match str::from_utf8(chunk) { | |
Ok(v) => v, | |
Err(e) => panic!("Invalid UTF-8 sequence: {}", e), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
set background=dark | |
call plug#begin('~/.vim/plugged') | |
Plug 'mileszs/ack.vim' | |
Plug 'sjl/badwolf' | |
Plug 'vim-scripts/camelcasemotion' | |
Plug 'JazzCore/ctrlp-cmatcher' | |
Plug 'ctrlpvim/ctrlp.vim' | |
Plug 'beyondmarc/hlsl.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eNqzf37MYCa3sbH990P9BgwMDPYfGMDA/pKV3jHJmTPtz29fvePmzBn2D21WSR0NDbV/cb4+a29omAOrU3HF9PJy+ze1W6fzvXtvv3MmCMyyv+FzYYICUP8x7prVE4/42L+20uLfKChof6b4xcz7sRr2hwU+FYuXV9h/M8ht3b17N9AqRvsPMqFRK9fssX96zcL77917/4HA/oMqe7Hc7J32N6ZPbHZxcQGqY7Z/tuRtrKGan/2tmE86WatWg935YfqqvsWZM+y/djn3nejoBOl14O89yVMyKdj+6acjQRkdXUBlLA6Sir9DXHQl7A+WiS6qy5wDFGN1EHp3wfrHhk32F7r06zcbGwPF2BwkVm0Lt3iqbf90bmSLMFDsyjtWhlv/hBhkDSsYJq3yZvg+SYZBeckEhqgFDxk05FgZMhacZ8jyrGAoD9Fj+PVNiGFauCiDVstzhtN5fxnerd8OsgcAyxWXLA== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsafe fn as_undead<'a, T>(t: &T) -> &'static T { | |
// I say, we can dance, we can dance | |
// Everybody look at your hands | |
&*(t as *const T) | |
} | |
unsafe fn as_undead_mut<'a, T>(t: &'mut T) -> &'static mut T { | |
// We can dance, we can dance | |
// Everybody's taking the chance | |
&mut *(t as *mut T) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:get_visual_selection() | |
" Why is this not a built-in Vim script function?! | |
let [lnum1, col1] = getpos("'<")[1:2] | |
let [lnum2, col2] = getpos("'>")[1:2] | |
let lines = getline(lnum1, lnum2) | |
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)] | |
let lines[0] = lines[0][col1 - 1:] | |
return join(lines, "\n") | |
endfunction |
NewerOlder