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 struct MyStruct { | |
num: i32 | |
} | |
impl MyStruct { | |
// setting to "pub", makes the warning disappear | |
fn new() -> MyStruct { | |
MyStruct { num : 2 } | |
} |
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
(defun rust-test-fn (code expected-result) | |
(with-temp-buffer | |
(rust-mode) | |
(insert code) | |
;; check window before formatting | |
(let (w-start (window-start)) | |
(message "%s" w-start) | |
) | |
(rust-format-buffer) | |
(should (equal expected-result (buffer-string))) |
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
#!/usr/bin/env bash | |
# set -x | |
# /usr/lib/gnome-settings-daemon/gsd-backlight-helper | |
#Application Options: | |
# --set-brightness Set the current brightness | |
# --get-brightness Get the current brightness | |
# --get-max-brightness Get the number of brightness levels supported |
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
struct Foo {} | |
impl Bar for Foo { | |
fn dummy_spacer() -> bool { | |
false | |
} | |
fn dummy_spacer() -> bool { | |
false | |
} |
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
// Create these files on a webserver (also localhost is ok) and point your browser there | |
// Reference: https://developer.mozilla.org/en-US/docs/Web/OpenSearch | |
// lg.html | |
<html lang="en-US" dir="ltr" class="no-js"> | |
<head prefix="og: http://ogp.me/ns#"> | |
<meta charset="utf-8"> | |
<link rel="search" type="application/opensearchdescription+xml" href="/lg_osd.xml" title="Langenscheidt Ita-Deu"/> | |
You should see a + icon on the custom search engine box. |
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
#![deny(warnings)] | |
extern crate tokio; | |
extern crate tokio_io; | |
use std::sync::{Arc, Mutex}; | |
use std::net::{Shutdown, SocketAddr}; | |
use tokio::net::{TcpListener, TcpStream}; | |
use tokio::prelude::*; |
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
extern crate encoding; | |
use std::io::prelude::*; | |
use std::io::{BufReader, BufWriter}; | |
use std::env; | |
use std::net::{Shutdown, TcpStream}; | |
use encoding::{EncoderTrap, Encoding}; | |
use encoding::all::ASCII; | |
fn main() { |
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
#!/usr/bin/env python3 | |
# Convert XML file from the firefox (pre-Quantum) extension | |
# into a CSV suitable to be imported into keepassxc | |
# Notes: | |
# - Python3 only! | |
# - password must be exported in plain text | |
# - requires defusedxml package ("pip install defusedxml") |
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
### install deps | |
Reference here: https://medium.com/@ianjsikes/get-started-with-rust-webassembly-and-webpack-58d28e219635 | |
### create a binary rust project | |
### write a public function | |
### compile Rust code targeting WASM | |
wargo build (i.e. cargo build --target=wasm32-unknown-emscripten) | |
### test binary |
NewerOlder