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
var http = require('http'); | |
var setHeader = http.OutgoingMessage.prototype.setHeader; | |
http.OutgoingMessage.prototype.setHeader = function() { | |
var match, submatch; | |
arguments[0] = arguments[0].replace(/\b(\w)/g, function(match, submatch) { | |
return submatch ? submatch.toUpperCase() : ""; | |
}); | |
setHeader.apply(this, arguments); | |
}; |
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
static void my_cool_main(int argc, char* argv[], char* envp[]) | |
{ | |
// your code goes here | |
} | |
__attribute__((section(".init_array"))) void (* p_my_cool_main)(int,char*[],char*[]) = &my_cool_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
function fish_prompt --description 'Write out the prompt' | |
set -l last_status $status | |
if not set -q __fish_prompt_normal | |
set -g __fish_prompt_normal (set_color normal) | |
end | |
# hostname emoji | |
for name in (hostname | tr . '\n') |
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
for i in *.mkv; do nice ffmpeg -i "$i" -c:v libx264 -preset slow -crf 20 -tune animation -profile:v high -level 4.0 -vf scale=-1:540 -c:a aac -strict -2 -ac 2 -c:s mov_text -map_metadata 0 -y "${i/.mkv/.mp4}" </dev/null; done |
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
#define cpu_relax() __builtin_ia32_pause() | |
#define cmpxchg(P, O, N) __sync_val_compare_and_swap((P), (O), (N)) | |
static unsigned _lock = 1; // read-write lock futex | |
const static unsigned _lock_open = 1; | |
const static unsigned _lock_wlocked = 0; | |
static void _unlock() | |
{ | |
unsigned current, wanted; |
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
Assembly 8 hrs 21 mins ██████▊░░░░░░░░░░░░░░ 32.4% | |
Markdown 4 hrs 6 mins ███▎░░░░░░░░░░░░░░░░░ 15.9% | |
C 3 hrs 42 mins ███░░░░░░░░░░░░░░░░░░ 14.3% | |
C++ 1 hr 42 mins █▍░░░░░░░░░░░░░░░░░░░ 6.6% | |
JSON 1 hr 37 mins █▎░░░░░░░░░░░░░░░░░░░ 6.3% |
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 crate::{constants, GameGraphics}; | |
use bevy::{ | |
app::startup_stage, | |
input::{ | |
keyboard::{KeyCode, KeyboardInput}, | |
mouse::MouseButtonInput, | |
}, | |
math::{vec2, Vec2}, | |
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
let mut registry = TypeRegistryInternal::default(); | |
registry.register::<f32>(); | |
registry.register::<bool>(); | |
registry.register::<Vec2>(); | |
registry.register::<components::Position>(); | |
registry.register::<components::KineticBody>(); | |
... | |
for entity in entities.iter() { | |
if let Some(location) = world.get_entity_location(*entity) { | |
let archetype = &world.archetypes[location.archetype as usize]; |
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
const STEPS: usize = 16; | |
let pos = vec2(collider.x, collider.y); | |
let mut vertices = Vec::with_capacity(STEPS); | |
for step in 0..STEPS { | |
let m = Transform::FromOrigin { | |
pos, | |
scale: vec2(1.0, 1.0), | |
rot: ((2. * PI / STEPS as f32) * step as f32, Vec2::zero()), | |
} | |
.matrix(); |
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
--- models/generate.orig.js 2022-02-16 16:38:08.286386783 +0100 | |
+++ models/generate.js 2022-02-16 16:38:08.285386773 +0100 | |
@@ -343,11 +343,11 @@ | |
function handleField(field) { | |
let r = '' | |
if (field.description) r += ` /** ${sanitizeComment(field.description)} */\n` | |
- r += ` ${field.name}: ${handleFieldType(field.name, field.type)},` | |
+ r += ` ${field.name}: ${handleFieldType(field.name, field.type, field.args)},` | |
return r | |
} |