Skip to content

Instantly share code, notes, and snippets.

View ahmednuaman's full-sized avatar
💭
I'm hiring! https://firemind.io/careers

Ahmed Nuaman ahmednuaman

💭
I'm hiring! https://firemind.io/careers
View GitHub Profile
@ahmednuaman
ahmednuaman / library.php
Last active December 15, 2015 20:41
Codeigniter Library
<?php
class Library {
private $CI;
public function __construct() {
$this->CI =& get_instance();
}
}
@ahmednuaman
ahmednuaman / model.php
Last active December 15, 2015 20:41
Codeigniter Model
<?php
class Model extends CI_Model {
public function __construct() {
parent::__construct();
}
}
@ahmednuaman
ahmednuaman / .bowerrc
Created April 4, 2013 13:29
Basic Bower config file
{
"directory": "assets/vendor",
"json": "component.json",
"endpoint": "https://bower.herokuapp.com"
}
@ahmednuaman
ahmednuaman / package.json
Created April 4, 2013 09:33
Basic package.json
{
"version": "0.0.1",
"name": "",
"description": "",
"dependencies": {
},
"devDependencies": {
}
@ahmednuaman
ahmednuaman / bbh-labs-feed.php
Created April 4, 2013 09:05
Testing BBH labs RSS feed
<?php echo file_get_contents('http://bbh-labs.com/feed/'); ?>
@ahmednuaman
ahmednuaman / index.html
Last active December 14, 2015 16:29
Samsung 2012 wrapper
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script src="$MANAGER_WIDGET/Common/af/2.0.0/loader.js"></script>
<script src="$MANAGER_WIDGET/Common/API/Widget.js"></script>
<style>
html,
body {
@ahmednuaman
ahmednuaman / timecode-data.js
Created January 21, 2013 19:54
Sample timecode data
var data = {
'1234': {
type: 'start',
data: 'hellos'
},
'5678': {
type: 'stop'
},
'9101': {
type: 'start',
@ahmednuaman
ahmednuaman / kayak-casper.js
Created January 14, 2013 21:46
CasperJS: get some flights off kayak.com
// here we're getting a casper reference using requirejs (since this all runs off nodejs)
var casper = require('casper').create();
// now we need to select the airlines
var airlines = ['EI', 'BA', 'VS'];
casper.start('http://www.kayak.co.uk/#/flights/LON-NYC/2013-01-28/2013-02-04', function()
{
// select our first airline
this.click('#fs_airlines_' + airlines.shift() + '_only');
@ahmednuaman
ahmednuaman / index.html
Last active December 11, 2015 02:19
A simple HTML boilerplate
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
</head>
<body>
@ahmednuaman
ahmednuaman / script.sh
Created January 1, 2013 15:22
Resize and rename (lower case, replace spaces with underscores) images in subfolders
#!/usr/bin/bash
for folder in images/*; do
for file in $folder/*.jpg; do
convert "$file" -resize 1200 -quality 60 -interlace line -strip ../path/to/dest/$(basename $folder | tr [:upper:] [:lower:])/$(basename ${file// /_} | tr [:upper:] [:lower:])
done
done