Skip to content

Instantly share code, notes, and snippets.

View valbaca's full-sized avatar

Valentin Baca valbaca

View GitHub Profile
// readable solution
var TestTester = exports;
TestTester.run = function(string) {
var good = 'Good test data'
, bad = 'Mismatch! Bad test data'
, splitString = string.split(' ')
, output = bad
if (splitString[0] === '0') {
output = ( isMirrors(splitString[1], splitString[2]) ? good : bad )
char cId[5];
if (id < 10) {
sprintf(cId, "000%d", id);
} else if (id < 100) {
sprintf(cId, "00%d", id);
} else if (id < 1000) {
sprintf(cId, "0%d", id);
} else {
sprintf(cId, "%d", id);
}
@valbaca
valbaca / clib_short_notes.c
Created June 16, 2018 21:14
succinct reference for the most used parts of C11 Standard Library, everything except time.h fits on one printed page. NOT meant to be comprehensive, but a reference for learning.
/* use $ man 3 <function> */
#include <stdlib.h>
void *calloc(size_t nitems, size_t size);
void *malloc(size_t size);
void *realloc(void *ptr, size_t size);
void free(void *ptr);
int rand(void); /* [0, RAND_MAX), use random() or arc4random() instead */
void srand(unsigned int seed);
#include <math.h>
plugins=(
git
colored-man-pages
colorize
common-aliases
github
# golang
# lein
node # usage: node-docs fs
npm
package com.valbaca;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class Gens {
public static void main(String[] args) {
List<Class> classes = new ArrayList<>();
classes.add(String.class);
diff --git a/src/main.rs b/src/main.rs
index 61a0589..9cf361e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,12 +40,8 @@ impl<'a> Buffer<'a> {
pub fn from_data<T: Copy>(device: &'a Device, _data: &[T]) -> Self {
let mut staging_buffer = Buffer::new(device);
- {
- let staging_buffer_memory = staging_buffer.memory_mut();
module.exports = {
env: {
es2021: true,
node: true
},
extends: 'eslint:recommended',
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
package testers
import (
"bufio"
"bytes"
"fmt"
"os"
"strconv"
)
package testers
import (
"bufio"
"bytes"
"fmt"
"os"
"strconv"
)
Clojure naming conventions
a agent
b body macro body
bind binding macro binding vector
c coll collection
c class
e expr expression
f g h function
i index