Skip to content

Instantly share code, notes, and snippets.

View jbenner-radham's full-sized avatar

James Benner jbenner-radham

View GitHub Profile
@jbenner-radham
jbenner-radham / App.vue
Created February 18, 2018 20:14
A minimal Vue.js single file component.
<template>
<h1>Hello World!</h1>
</template>
<script>
export default {
name: 'app'
}
</script>
@jbenner-radham
jbenner-radham / index.js
Last active February 18, 2018 20:05
The JS entry point for a Vue.js single file component setup via webpack and Babel.
'use strict';
import App from '../components/App.vue';
import Vue from 'vue';
new Vue({
el: '#app',
render: h => h(App)
});
@jbenner-radham
jbenner-radham / webpack.config.js
Last active February 17, 2018 23:35
A somewhat minimal webpack config file for JS via Babel, with a dev server and hot module replacement.
'use strict';
const path = require('path');
const webpack = require('webpack');
module.exports = {
/** @see https://webpack.js.org/configuration/entry-context/#entry */
entry: './src/js/index.js',
/** @see https://webpack.js.org/configuration/output/ */
@jbenner-radham
jbenner-radham / Vagrantfile
Created August 14, 2017 23:25
Python 2.7 Dev Env
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@jbenner-radham
jbenner-radham / py3-venv-Flask.Makefile
Last active July 17, 2017 21:51
A Makefile to setup a Python 3 venv.
VENV_INSTALL_DIR = venv
# The first target listed acts as the default.
install:
@python3 -m venv ${VENV_INSTALL_DIR}
@. ${VENV_INSTALL_DIR}/bin/activate && pip3 install Flask > /dev/null && python3 -c \
"import subprocess; \
import re; \
flask_info = subprocess.run('pip3 show Flask', encoding='utf-8', shell=True, stdout=subprocess.PIPE).stdout; \
flask_version = re.compile('Version: ([0-9]+.[0-9]+)').search(flask_info)[1]; \
@jbenner-radham
jbenner-radham / Makefile
Last active April 23, 2017 21:03
Fun with linked list data structures!
STD = -std=c99
# > If there are C compiler options that must be used for proper compilation of
# > certain files, do not include them in CFLAGS. Users expect to be able to
# > specify CFLAGS freely themselves. Instead, arrange to pass the necessary
# > options to the C compiler independently of CFLAGS, by writing them
# > explicitly in the compilation commands or by defining an implicit rule [...]
CFLAGS = $(STD) -O2 -pedantic -Wall -Wextra -Iinclude -g -fsanitize=address -fno-omit-frame-pointer
# The first target listed acts as the default.
@jbenner-radham
jbenner-radham / paper_word_count.c
Last active April 20, 2017 00:10
Comparing a couple different function implementations.
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <string.h>
#define PENCIL_SPACE ' '
size_t paper_word_count(char *paper)
{
size_t count = 0;
@jbenner-radham
jbenner-radham / README.md
Last active February 11, 2024 23:04
An opinionated Jasmine spec generator for AMD modules.

Jasmine Spec Generator

An opinionated Jasmine spec generator for AMD modules.

Installation

$ npm install && chmod +x cli.js

Search For An Item With the Label "Sega Mega Drive"

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT * WHERE {
    ?id rdfs:label "Sega Mega Drive"@en
}