alias batman="sudo apt-get update -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y"
alias gs="git status"
alias ga="git add ."
alias gc="git commit -m"
alias gp="git pull"
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
RUST_BACKTRACE=1 cargo build | |
Compiling rust v0.1.0 (file:///Users/RJPB2/Documents/rustedrails/bin/embedded/rust) | |
error: linking with `cc` failed: exit code: 1 | |
note: "cc" "-m64" "-L" "/Users/RJPB2/.multirust/toolchains/nightly/lib/rustlib/x86_64-apple-darwin/lib" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/nth_prime.0.o" "-o" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/libnth_prime.dylib" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/nth_prime.metadata.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug" "-L" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/deps" "-L" "/Users/RJPB2/.rbenv/versions/2.3.0/lib" "-L" "/Users/RJPB2/.multirust/toolchains/nightly/lib/rustlib/x86_64-apple-darwin/lib" "-Wl,-force_load,/var/folders/db/31c017ks01x4sgzbfzzrvl780000gn/T/rustc.8QXOubNLwv5f/libruru-90b63cc301e85c86.rlib" "-Wl,-force_load,/var/folders/db/31c017ks01x4sgzbfzzrvl780000 |
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
#[no_mangle] | |
pub extern fn read_json(ro: *const c_char) -> *const c_char { | |
let roo = make_string(ro); | |
let json_for_rust: HashMap<String, i32> = json::decode(&roo).unwrap(); | |
let encoded = json::encode(&json_for_rust).unwrap(); | |
let concated_string = CString::new(encoded).unwrap(); | |
concated_string.into_raw() | |
} | |
fn make_string(s1: *const c_char) -> String { |
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 rustc_serialize; | |
use rustc_serialize::json::{self}; | |
use std::collections::HashMap; | |
use std::ffi::CStr; | |
use std::ffi::CString; | |
use std::os::raw::c_char; | |
#[no_mangle] | |
pub extern fn read_json(ro: *const c_char) -> *const c_char { |
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
class RustPoro | |
extend FFI::Library | |
@ffi_lib_path = BinaryPath.new.rust_binary | |
ffi_lib @ffi_lib_path | |
attach_function :read_json, [:string], :string | |
end |
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 rustc_serialize; | |
extern crate stringer; | |
use rustc_serialize::json::{self}; | |
use std::collections::HashMap; | |
use std::ffi::CString; | |
use std::os::raw::c_char; | |
use stringer::*; | |
#[no_mangle] |
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
lspi.createRecord("testOne") | |
// Now that you have created a record try grabbing it | |
lspi.getRecord("testOne") | |
// This returns an empty object. Now we add a real object | |
lspi.updateRecord("testOne", {test: "Basic data for the 'testOne' record"}) |
Here is the link to the rustup website
Here are the docs for rustup
curl https://sh.rustup.rs -sSf | sh
(This is now the official rust version manager!)
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
localStorage.setItem('wow', "hello") | |
localStorage.getItem('wow') | |
console.log('ok') | |
alert('WOW') |