Skip to content

Instantly share code, notes, and snippets.

@andersonsp
andersonsp / Makefile
Last active August 29, 2015 13:57
Valenok's QVM
# Copyright (c) 2006, 2007 by Sergey Lyubka
# All rights reserved
#
# $Id$
SRCS= q.c
PROG= q
CFLAGS= -W -Wall -g -pedantic -ansi -D_BSD_SOURCE $(COPT)
all: $(PROG)
// lys.c forth version by AndersonSP
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdarg.h>
//----------------------------------------------------------------
// Object defs based on http://piumarta.com/software/id-objmodel/
var humanizedValue = value.replace(/_/g, ' ').replace(/(\w+)/g, function(match) {
return match.charAt(0).toUpperCase() + match.slice(1);
});

Advertised:

  • best graphics
  • decent AI
  • free to play
  • infinite possibilities.

Actual Gameplay:

  • single spawn
  • no save point
  • not moddable
@andersonsp
andersonsp / bit_array.c
Last active August 29, 2015 14:03
Simple utils, algorithms and data structures implemented in C
#include <limit.h> /* for CHAR_BIT */
#include <stdint.h> /* for uint32_t */
typedef uint32_t word_t;
enum { BITS_PER_WORD = sizeof(word_t) * CHAR_BIT };
#define WORD_OFFSET(b) ((b) / BITS_PER_WORD)
#define BIT_OFFSET(b) ((b) % BITS_PER_WORD)
void set_bit(word_t *words, int n) {
words[WORD_OFFSET(n)] |= (1 << BIT_OFFSET(n));
@andersonsp
andersonsp / pump.bas
Last active August 29, 2015 14:05 — forked from anonymous/pump.bas
Device 16F877A
XTAL 20 'Cristal de 20Mhz
ALL_DIGITAL true 'Todos los puertos Digitales
'TRISA=%00000000
TRISB=%00000111 'Configuracion del Puerto A
Dim a As Byte
pump:
a = PORTB & %00000111
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define LOCALS_MAX 10
#define STACK_MAX 10
typedef unsigned char byte;
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
@andersonsp
andersonsp / pattern_input.html
Last active September 10, 2015 19:33
Sample code for a required input field with a specific pattern
<input name="text field" value="", pattern="\d+" class="valid_number" title="El valor debe ser numérico" required="required" />
@andersonsp
andersonsp / shell_snippets.sh
Last active October 13, 2016 21:50
Shell snippets
## copy all *.example files usable files
for ex in config/*.yml.example(:t:r) do
[[ -a config/${ex} ]] || cp config/${ex}.example config/${ex}
done
# it updates _just_ one gem and uses the specified Gemfile
BUNDLE_GEMFILE=Gemfile.other bundle update --source awesome_gem
# do a loop task with a progressbar
events=4000;