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::f32::consts::TAU; | |
use bevy::prelude::*; | |
use bevy_rapier3d::prelude::*; | |
fn main() { | |
let mut app = App::new(); | |
#[cfg(target_arch = "wasm32")] | |
app.add_system(handle_browser_resize); |
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
diff --git a/.cargo/config.toml b/.cargo/config.toml | |
new file mode 100644 | |
index 0000000..f51f913 | |
--- /dev/null | |
+++ b/.cargo/config.toml | |
@@ -0,0 +1,2 @@ | |
+[target.x86_64-apple-darwin] | |
+rustflags = ["-C", "link-arg=-fuse-ld=/Users/mburr/bin/zld"] | |
diff --git a/Cargo.toml b/Cargo.toml | |
index 0d54bf7..50c2f97 100644 |
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 Sieve<'a> { | |
primes: &'a mut Vec<u32>, | |
} | |
impl<'a> Sieve<'a> { | |
pub fn new(primes: &'a mut Vec<u32>) -> Self { | |
Sieve { primes } | |
} | |
} |
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 exception_error_handler($errno, $errstr, $errfile, $errline ) { | |
throw new ErrorException($errstr, $errno, 0, $errfile, $errline); | |
} | |
set_error_handler("exception_error_handler"); |
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
# I was able to just put this module alongside `models.py` and use `myapp.db.FooTable(**kwargs).save()` etc outside | |
# of the web framework. With no issues, so far. | |
import django | |
from .settings import * | |
from django.conf import settings | |
settings.configure(DATABASES=DATABASES) | |
django.setup() |
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
#!/bin/sh | |
# hacky but useable script for quick/easy parity test node deployment. Requires commands "parity" and "tmux" | |
# Set these as required: | |
BASE_PATH=~/meth/nodes | |
BIND_IP=10.45.92.1 | |
LOG_LEVEL=info |
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
;; from http://ergoemacs.org/emacs/rename_file_pattern.html | |
To rename multiple files in emacs, the most easy way is: | |
Alt+x dired to go to the directory. | |
Alt+x dired-toggle-read-only 【Ctrl+x Ctrl+q】. | |
Then, just edit the file names. | |
When done, wdired-finish-edit 【Ctrl+c Ctrl+c】 to commit the changes. | |
To abort, Alt+x wdired-abort-changes 【Ctrl+c Ctrl+k】. |
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
#!/bin/sh | |
# https://wiki.parity.io/Private-development-chain | |
# https://github.com/paritytech/parity/issues/7470 | |
# 0x00a329c0648769a73afac7f9381e08fb43dbea72 | |
BASE_PATH=~/meth/nodes | |
BIND_IP=10.45.92.1 | |
LOG_LEVEL=info |
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-input-mode t nil 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
import os | |
s = os.statvfs('/') | |
use = 1 - float(s.f_bavail) / float(s.f_blocks) |
NewerOlder