Skip to content

Instantly share code, notes, and snippets.

View wbashir's full-sized avatar

Warsame Bashir wbashir

View GitHub Profile
@wbashir
wbashir / physics.swift
Created July 22, 2015 15:47
Learn spritekit
http://www.spritekitlessons.com/day-5-learn-sprite-kit-and-swift/
@wbashir
wbashir / do_complete.py
Created April 18, 2015 00:01
Do Complete func
https://github.com/mitsuhiko/click/blob/master/click/_bashcomplete.py#L42
def do_complete(cli, prog_name):
cwords = split_arg_string(os.environ['COMP_WORDS'])
cword = int(os.environ['COMP_CWORD'])
args = cwords[1:cword]
try:
incomplete = cwords[cword]
except IndexError:
incomplete = ''
@wbashir
wbashir / gist:a6a749d8abc29f3bec8e
Created February 20, 2015 04:09
Fiber Parent Callback
uploadS3: function (file, callback, callbackArgs) {
var s3 = new AWS.S3();
var options = {
partSize: 10 * 1024 * 1024,
queueSize: 1
};
s3.upload(file, options, function (error, data) {
if (callback) {
Meteor.wrapAsync(Meteor.call(callback, callbackArgs, {error: error, data: data})); //Barfs
/*Main.java*/
public class Main {
public static void main(String[] args) {
Animal dog = new Dog();
dog = new Name(dog, "Fido");
dog = new Color(dog, "brown");
@wbashir
wbashir / flot
Created April 17, 2014 22:03
Flot tooltip
$(function () {
var d1 = [];
for (var i = 0; i < 14; i += 0.5)
d1.push([i, Math.sin(i)]);
var data = [
{ label: "IE", data: 19.5, color: "#4572A7"},
{ label: "Safari", data: 4.5, color: "#80699B"},
{ label: "Firefox", data: 36.6, color: "#AA4643"},
{ label: "Opera", data: 2.3, color: "#3D96AE"},
{ label: "Chrome", data: 36.3, color: "#89A54E"},
@wbashir
wbashir / gist:10913517
Created April 16, 2014 17:53
Random Styles
cta-button {
display: inline-block;
padding: 17px 31px;
border-radius: 3px;
background-color: #8f69d9;
box-shadow: rgba(0, 0, 0, 0.09) 0px 2px 0px 0px;
-webkit-transition: background-color 300ms ease;
-o-transition: background-color 300ms ease;
transition: background-color 300ms ease;
font-family: proxima-nova, sans-serif;
@wbashir
wbashir / gist:9877344
Created March 30, 2014 18:26
Rendered Call Back - Meteor initializing JQuery plugins
<template name="t1">
<select id="selector"></select>
</template>
Tempalate['t1'].rendered = function(){
//attach to a DOM element with JQuery plugin
$('#selector').someJQueryPluginIn({}); //initializing
}
//Using node-elasticsearch-client and meteor-npm
var ElasticSearchClient = Meteor.require('elasticsearchclient'),
url = Npm.require('url');
//local elastic search envrionment running on port 9200
// create an _opts object for remote systems with credentials: See ElasticSearch documentation
var serverOptions = {
host: 'localhost',
port: 9200,
@wbashir
wbashir / gist:7668685
Created November 27, 2013 00:18
WayPoints trigger on page holder bottom or when user scrolls to bottom of window
///Markup
<div id="st-container" class="st-container">
<div class=" fullscreen-container animated fadeInDown" id="fullscreen-container">
<div class=" custom_inner offset2" id="fullScreenAyahs">
<div class="pageHolder" id="">
</div>
<div class="pageHolder" id="">
</div>
@wbashir
wbashir / gist:7254053
Created October 31, 2013 17:55
Example
<div class="PlainText">
Date: 2013-10-28 20:00:43 -0500<br>
Source: Text<br>
Incident type: Text<br>
Incident detection rule: Text (ID=19762)<br>
Text: App - fard.com<br>
Text rating: 37<br>
Text: 171<br>
Description:&nbsp;Text d<br>
<br>