Skip to content

Instantly share code, notes, and snippets.

View warmwaffles's full-sized avatar
🛠️
Code Wrestling

Matthew Johnston warmwaffles

🛠️
Code Wrestling
View GitHub Profile
FROM ruby:2.2.0
RUN apt-get update -qq && \
apt-get install -y \
build-essential \
libpq-dev \
postgresql-client \
libxml2-dev \
libxslt1-dev \
nodejs && \
#!/bin/bash
set -e
echo "==> Cleaning..."
docker rm $(docker ps -a -q
echo "==> Complete"
# Maintainer: Arthur Zamarin <[email protected]>
# Updated By: Matthew Johnston <[email protected]>
#
pkgname=clib
pkgver=1.4.2
pkgrel=1
pkgdesc="C package manager-ish"
arch=(i686 x86_64)
url="https://github.com/clibs/clib"
require 'mail'
class EmailValidator < ActiveModel::EachValidator
def valid_email?(value)
a = Mail::Address.new(value)
if a.domain && a.address == value
elements = a.domain.split(/\./)
a.domain.match(/\A\S+\Z/) && elements.none?(&:blank?) && elements.size > 1
else
/// Seed of Andromeda Icosphere Generator
/// Written by Frank McCoy
/// Use it for whatever, but remember where you got it from.
///
/// SEE: https://www.seedofandromeda.com/blogs/49-procedural-gas-giant-rendering-with-gpu-noise
/// SEE: http://pastebin.com/aFdWi5eQ
#include <cstdint>
#include <unordered_map>
#include <vector>
#include "minitest.h"
int main(int argc, const char *argv[]) {
ASSERT_TRUE(0, "expected 0 to be true");
ASSERT_FALSE(0, "expected 0 to be false");
return 0;
}
#ifndef UTILS_LOGGING_H
#define UTILS_LOGGING_H
#include <stdio.h>
/**
* Default logging level will be INFO
*/
#ifndef LOGLEVEL
#define LOGLEVEL 4
.
├── assets
├── build
│   ├── book.epub
│   ├── book.epub3
│   └── book.html
├── Rakefile
├── scratch
├── src
│   ├── backmatter
/*
* Generic hashmap manipulation functions
* SEE: http://elliottback.com/wp/hashmap-implementation-in-c/
*/
#ifndef __HASHMAP_H__
#define __HASHMAP_H__
#define MAP_MISSING -3 /* No such element */
#define MAP_FULL -2 /* Hashmap is full */
#include <stdint.h>
#include <string.h>
uint32_t float_to_raw_bits(float x)
{
uint32_t y;
memcpy(&y, &x, 4);
return y;
}