Skip to content

Instantly share code, notes, and snippets.

@ianjuma
ianjuma / bootstrap-plugins.txt
Created August 17, 2012 00:42 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-alert.js
bootstrap-button.js
bootstrap-carousel.js
bootstrap-collapse.js
bootstrap-dropdown.js
bootstrap-modal.js
bootstrap-scrollspy.js
bootstrap-tab.js
@ianjuma
ianjuma / defn-koans.clj
Last active December 31, 2015 05:59
clojure koans on functions and closures
(defn multiply-by-ten [n]
(* 10 n))
(defn square [n] (* n n))
(meditations
"Functions are often defined before they are used"
(= __ (multiply-by-ten 2))
"But they can also be defined inline"
@ianjuma
ianjuma / client-server.go
Created December 13, 2013 20:04
Sample Go client-server
package main
import (
"encoding/json"
"fmt"
"net"
)
func server() {
ln, err := net.Listen("", ":8000")
@ianjuma
ianjuma / Makefile
Last active August 29, 2015 13:56
simple CV, CL Makefile
# Copyright (C) 2013 Ian <wjuma@students.usiu.ac.ke>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@ianjuma
ianjuma / nginx subdomains config
Last active December 6, 2020 13:41
Nginx subdomain sample config
worker_processes 5;
error_log /var/log/nginx/error.log;
pid /var/log/nginx/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
use epoll;
@ianjuma
ianjuma / model.py
Created February 15, 2014 13:39
mongoengine document example
#! /usr/bin/env python
from mongoengine import *
import datetime
GENDER = (("M", "Male"),
("F", "Female"))

Open Computing Language (OpenCL) is a language and framework for writing computationally intensive kernels that run accross heterogenious platforms, including GPUs, CPUs, and perhaps other more esoteric devices.

Intel provides an OpenCL implementation for Intel CPUs, but there's not a lot of instructions on how to get it set up. Here's what I did.

Installing Intel CPU OpenCL on Ubuntu (12.04)

  1. Download the Intel® SDK for OpenCL* Applications XE 2013 from the Intel website, here http://software.intel.com/en-us/vcsource/tools/opencl-sdk-xe. The download is a tarball -- the one I got is called intel_sdk_for_ocl_applications_2013_xe_sdk_3.0.67279_x64.tgz
  2. Unpack the tarball and cd into the new directory
#! /usr/bin/env python
## Encryption and decryption using AES algorithm
## with a salting function
## two-one way functions defined - encrypt() / decrypt()
import hashlib
import random, os
import base64
#! /usr/bin/env python
## Encryption and decryption using AES algorithm
## with a salting function
## two-one way functions defined - encrypt() / decrypt()
import hashlib
import random
import os
# ENGINE=INNODB;
CREATE TABLE Person (
id NUMBER(10) NOT NULL,
name VARCHAR(100) NOT NULL,
gender VARCHAR(1) NOT NULL,
email varchar(100) NOT NULL,
major varchar(3),
address VARCHAR(100) NOT NULL,
telephone NUMBER(15) NOT NULL,