Skip to content

Instantly share code, notes, and snippets.

View ultimateprogramer's full-sized avatar

Ahmed Maawy ultimateprogramer

View GitHub Profile
@pbojinov
pbojinov / README.md
Last active November 5, 2025 23:10
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@hojberg
hojberg / app_route_target.js
Last active September 5, 2019 09:36
Simple Aviator/React example. Read more about Aviator here: https://github.com/swipely/aviator
/** @jsx React.DOM */
var AppRouteTarget = {
setupLayout: function () {
React.renderComponent({
<App className='page-content'>,
document.querySelector('body')
});
}
};
@jah2488
jah2488 / raycast.hx
Created April 29, 2014 18:56
A simple raycasting proof of concept I did a few months back in haxe/openfl. Think of the original doom. Its kinda like that.
package;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.Lib;
import flash.ui.Keyboard;
import flash.Vector;
@barnabyc
barnabyc / routes.js
Last active May 4, 2025 21:43
Aviator/React example
import Aviator from 'vendor/aviator';
import ServerRouteTarget from 'route_targets/server_route_target';
let Routes = {
/**
Call this method `Routes.dispatch` to start routing.
@method dispatch
@param {Object} targets
@example { 'nameOfMyRouteTarget': instanceOfMyRouteTarget }
@martinrusev
martinrusev / cron_supervisord.ini
Last active May 6, 2025 09:49
Cron supervisord
[supervisord]
nodaemon=true
loglevel=debug
[program:amon]
command=gunicorn -c gunicorn.conf.py wsgi
directory=/amon
autostart=true
autorestart=true
redirect_stderr=true
@mchow01
mchow01 / TWTR-mongo.py
Created March 16, 2015 20:13
Store tweets from a Twitter timeline into a Mongo database using Tweepy
import tweepy
import pymongo
# Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html
# PyMongo API doc here: https://pypi.python.org/pypi/pymongo/
# Keys
consumer_key = ''
consumer_secret = ''
access_token = ''
@jczaplew
jczaplew / pgFormatDate.js
Created April 24, 2015 14:11
Javascript Date to Postgres-acceptable format
// Convert Javascript date to Pg YYYY MM DD HH MI SS
function pgFormatDate(date) {
/* Via http://stackoverflow.com/questions/3605214/javascript-add-leading-zeroes-to-date */
function zeroPad(d) {
return ("0" + d).slice(-2)
}
var parsed = new Date(date)
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active December 24, 2025 06:08
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@mbbx6spp
mbbx6spp / ALTERNATIVES.adoc
Last active September 30, 2025 14:13
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
@elevenetc
elevenetc / TextViewWithImages.java
Last active July 28, 2017 01:00
TextViewWithImages.java
//<string name="can_try_again">Press [img src=ok16/] to accept or [img src=retry16/] to retry</string>
//http://stackoverflow.com/questions/15352496/how-to-add-image-in-a-textview-text
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.content.Context;
import android.text.Spannable;
import android.text.style.ImageSpan;
import android.util.AttributeSet;
import android.util.Log;