I hereby claim:
- I am juancampa on github.
- I am juancampa (https://keybase.io/juancampa) on keybase.
- I have a public key ASB9Zfyg2X1l1-aFc5WHC-WgMQcuoWgLZ4WD8wyUfl9xXQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| $ membrane query | |
| 'github:users.one(name:"facebook").repos.one(name:"react")' | |
| '{ | |
| issues { | |
| page { | |
| items { | |
| state | |
| comments | |
| self | |
| } |
| const fullAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
| const restrictedAlphabet = 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz'; | |
| const threadPrefix = 'thread-'; | |
| const messagePrefix = 'msg-'; | |
| const isWhitespace = str => /^[\s\xa0]*$/.test(str); | |
| const isInvalidString = str => str ? (str.indexOf(threadPrefix) !== -1 || str.indexOf(messagePrefix) !== -1) : false; | |
| const encode = function(str) { | |
| if (isWhitespace(str)) return str; |
| #!/bin/bash | |
| RUNS=5 | |
| for i in `seq 1 $RUNS`; do | |
| starttime=`date "+%s%3N"` | |
| # Generate a significant amount of output | |
| ls -Rl /usr/ /usr/ /usr/ /usr/ |
| server { | |
| listen 443 ssl http2; | |
| error_log stderr warn; | |
| ssl_certificate /etc/certs/nginx-selfsigned.crt; | |
| ssl_certificate_key /etc/certs/nginx-selfsigned.key; | |
| server_name localhost; | |
| location / { | |
| access_by_lua_block { |
| stashit () | |
| { | |
| for i in `seq 0 20`; | |
| do | |
| echo Changed files:; | |
| git stash show stash@{$i}; | |
| echo Untracked files:; | |
| git diff --summary stash@{$i}^2; | |
| echo; | |
| while true; do |
| #!/bin/sh | |
| # Any command invoked with the pind prefix gets stored along with its $PWD so | |
| # subsequent invocations are executed in the same directory. For example: | |
| # | |
| # $ pind pwd | |
| # /home/juan | |
| # $ cd /etc | |
| # $ pind pwd | |
| # /home/juan |
| // Helper function to center arbitrary widgets. It works by measuring the width of the widgets after rendering, and | |
| // then using that offset on the next frame. | |
| fn centerer(ui: &mut Ui, add_contents: impl FnOnce(&mut Ui)) { | |
| ui.horizontal(|ui| { | |
| let id = ui.id().with("_centerer"); | |
| let last_width: Option<f32> = ui.memory_mut(|mem| mem.data.get_temp(id)); | |
| if let Some(last_width) = last_width { | |
| ui.add_space((ui.available_width() - last_width) / 2.0); | |
| } | |
| let res = ui |
| #[extension_trait] | |
| pub impl UiExt for Ui { | |
| fn inner_shadow_top(&mut self, mut avail_rect: Rect, opacity: f32) { | |
| let painter = self.painter(); | |
| avail_rect.set_height(1.0); | |
| const STEPS: usize = 8; | |
| for i in 0..STEPS { | |
| let alpha = 1.0 - (i as f32 / STEPS as f32); | |
| let shift = avail_rect.height() * i as f32; | |
| let rect = avail_rect.translate((0.0, shift).into()); |
| pub fn render_switch(&self, ui: &mut Ui, id: Id, labels: &[&str; 2], selected: usize, available: Rect) -> Response { | |
| let text_color = ui.visuals().strong_text_color(); | |
| let galley1 = ui.fonts(|fonts| fonts.layout_no_wrap(labels[0].to_owned(), FontId::monospace(9.0), text_color)); | |
| let galley2 = ui.fonts(|fonts| fonts.layout_no_wrap(labels[1].to_owned(), FontId::monospace(9.0), text_color)); | |
| let margin = vec2(10.0, 4.0); | |
| // Initial estimation of the position. It will be moved below | |
| let rect = Rect::from_min_size(Pos2::ZERO, | |
| vec2( |