This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu | |
[[ -z "$(pgrep swaylock)" ]] || exit | |
[[ -z "$(pgrep convert)" ]] || exit | |
[[ -z "$(pgrep grim)" ]] || exit | |
TMPBG=/tmp/bg.png | |
grim $TMPBG |
This file contains hidden or 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
#!/bin/bash | |
for f in *.zip; do | |
mkdir "$(basename -s .zip "$f")"; | |
unzip "$f" -d "$(basename -s .zip "$f")"; | |
done |
This file contains hidden or 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
let work = client | |
.request(request) | |
.and_then(move |response| { | |
let (parts, body) = response.into_parts(); | |
body | |
.concat2() | |
.map(move |chunk| { | |
println!("{:?}", parts) | |
}) |
This file contains hidden or 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
extern crate hyper; | |
extern crate futures; | |
extern crate tokio; | |
use hyper::{Client}; | |
use hyper::rt::{Future, Stream}; | |
use futures::future::{join_all}; | |
fn main() { | |
let mut i = 7; |
This file contains hidden or 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
extern crate serde; | |
#[macro_use] | |
extern crate serde_derive; | |
extern crate serde_json; | |
use std::fs::File; | |
use std::io::Write; | |
#[derive(Serialize)] | |
struct Foo { |
This file contains hidden or 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
extern crate serde; | |
#[macro_use] | |
extern crate serde_derive; | |
extern crate serde_json; | |
use std::fs::File; | |
use std::io::Write; | |
#[derive(Serialize)] | |
struct Foo { |
This file contains hidden or 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
struct T { | |
handle: JoinHandle<()>, | |
} | |
impl Drop for T { | |
fn drop(&mut self) { | |
self.handle.thread().unpark(); | |
self.handle.join().unwrap(); | |
} | |
} |
This file contains hidden or 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
> [[][[]]+[]] | |
[ 'undefined' ] | |
> [+[]] | |
[ 0 ] | |
> [++[+[]][+[]]] | |
[ 1 ] | |
> [[][[]]+[]][+[]][++[+[]][+[]]] | |
'n' |
This file contains hidden or 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
server_key = pyelliptic.ECC(curve="prime256v1") | |
server_key_id = base64.urlsafe_b64encode(server_key.get_pubkey()[1:]) |
This file contains hidden or 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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_DIABETES", | |
"label": "Diabetes", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "influxdb", | |
"pluginName": "InfluxDB" | |
} |