Skip to content

Instantly share code, notes, and snippets.

View OElesin's full-sized avatar

Olalekan Fuad Elesin OElesin

View GitHub Profile
@japsu
japsu / README.md
Last active February 9, 2022 21:34
ARCHIVED: How to get NumPy and SciPy working in a virtualenv under Mac OS X

ARCHIVED: How to get NumPy and SciPy working in a virtualenv under Mac OS X

Please don't use this method any more, this is ages old (2014, Python 2.7).

Assuming you use virtualenv for Python library hygiene. Now you want Numpy and Scipy in your project.

NumPy and SciPy can not be easily installed under Mac OS X with a simple

pip install scipy
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@escapeboy
escapeboy / codeigniter-rating-lib.php
Last active October 2, 2020 17:35
CodeIgniter Rating Library + Microdata (optional)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Rating Library
* Using jQuery Raty plugin to rate products
* @author Nikola Katsarov
* @website http://katsarov.biz
*/
class Rating {
@debojitkakoti
debojitkakoti / seq_mongo_auto.php
Last active October 27, 2020 06:31
Auto Incrementing Sequence in mongodb using php mongo
<?php
$m = new MongoClient();
// select a database
$db = $m->seq;
// select a collection (analogous to a relational database's table)
$collection = $db->counters;
$user_collection = $db->user;
@heldrida
heldrida / javascript
Last active March 11, 2024 17:00
Facebook Javascript SDK: Basic Login and Logout example
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxxxxxxxx',
status: true,
cookie: true,
xfbml: true
});
@benshimmin
benshimmin / gist:4088493
Created November 16, 2012 16:03
Scale to fit and centre-align an image with FPDF
<?php
/* Caveat: I'm not a PHP programmer, so this may or may
* not be the most idiomatic code...
*
* FPDF is a free PHP library for creating PDFs:
* http://www.fpdf.org/
*/
require("fpdf.php");
class PDF extends FPDF {
@timothyklim
timothyklim / ip.scala
Created August 3, 2012 21:34
IP to long and reverse on Scala
import collection.mutable.ListBuffer
object NetworkUtils {
def ip2Long(ip: String): Long = {
val atoms: Array[Long] = ip.split("\\.").map(java.lang.Long.parseLong(_))
val result: Long = (3 to 0 by -1).foldLeft(0L)(
(result, position) => result | (atoms(3 - position) << position * 8))
result & 0xFFFFFFFF
}