Skip to content

Instantly share code, notes, and snippets.

View QQism's full-sized avatar

QQ QQism

View GitHub Profile
@QQism
QQism / serializer_benchmarks.rb
Last active January 6, 2020 01:01 — forked from aishfenton/serializer_benchmarks.rb
Performance comparison of different ruby serializer methods
# gem install bson
# gem install bson_ext
# gem install yajl-ruby
# gem install json
# gem install msgpack
# gem install oj
require 'rubygems'
require 'benchmark'
require 'yaml'
@QQism
QQism / hello_opencl.c
Created March 25, 2018 08:12
A Minimal OpenCL Example
#include <stdio.h>
#include <sys/stat.h>
#include <OpenCL/OpenCL.h>
#define ARRAY_SIZE 1024
cl_context CreateContext()
{
cl_int errNum = 0;
cl_uint numPlatforms = 0;
This will format python datetime as a string to be used within jinja conditionals for comparing current date to article date using pelican app.
1. Create a file named jinjaext.py
2. paste the following snippet
def convertdate(datetime, format='%a-%d-%m-%Y'):
return datetime.date().strftime(format)
3. Add the following line to your config file