const float PI = 3.1415926535897932384626433832795;
const float PI_2 = 1.57079632679489661923;
const float PI_4 = 0.785398163397448309616;
float PHI = (1.0+sqrtf(5.0))/2.0;
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
| #variation of http://urbangiraffe.com/2011/08/13/remote-editing-with-sublime-text-2/ that adds creating new folders remotely. | |
| import sublime_plugin, os | |
| class RemoteEdit(sublime_plugin.EventListener): | |
| def on_post_save(self, view): | |
| remote = { "/Users/jijo/work/project": ["/usr/bin/scp", None, "user@server", "~/project/", None] } | |
| for dirname, target in remote.iteritems(): | |
| if view.file_name().startswith( dirname ): |
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
| doug:rust-libs doug$ cat junk.rs | |
| #![crate_id = "junk#0.1"] | |
| use std::libc::c_int; | |
| #[no_mangle] | |
| pub extern fn dothing(a: c_int, b:c_int) -> c_int { | |
| return a + b; | |
| } |
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
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
| pub mod cv { | |
| extern crate libc; | |
| use self::libc::{c_char, c_double, c_int, c_schar, c_void}; | |
| #[repr(C)] | |
| pub struct HaarClassifierCascade; | |
| #[repr(C)] | |
| pub struct MemStorage; |
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
| ;you have to re-map the f keys so they work. | |
| ;Otherwise AHK will just 'wait' for the number key after - if there is non then nothing happens | |
| f1::f1 | |
| f2::f2 | |
| f3::f3 | |
| f4::f4 | |
| f5::f5 | |
| f6::f6 | |
| f7::f7 | |
| f8::f8 |
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
| use std::rc::Rc; | |
| trait HKT<U> { | |
| type C; // Current type | |
| type T; // Type with C swapped with U | |
| } | |
| macro_rules! derive_hkt { | |
| ($t:ident) => { | |
| impl<T, U> HKT<U> for $t<T> { |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #include <unistd.h> | |
| #include <sys/mman.h> | |
| #include <sys/stat.h> |