Skip to content

Instantly share code, notes, and snippets.

View emberian's full-sized avatar

emberian

View GitHub Profile
@emberian
emberian / gist:1813914
Created February 13, 2012 05:23 — forked from anonymous/gist:1813906
TheAbacus - pastebin.com/qY1e6sjm
// JavaScript Document
function Temp() {
var test = "testing";
}
Temp.prototype.init = function() {
test = this.test;
$.ajax({ //IE errors here.
url: "xd_subnav.xml",
dataType: "xml",
@emberian
emberian / gist:2019014
Created March 12, 2012 01:00 — forked from anonymous/gist:2018992
a guest on Mar 11th, 2012 - pastebin.com/0DWetuis
function secondsFromTime(string){
var split = string.split(":")
var seconds = parseInt(split.pop())
if (seconds !== NaN) {
var minutes = parseInt(split.pop())
if (minutes !== NaN) {
var hours = parseInt(split.pop())
if (hours !== NaN) {
return hours * 60 * 60 + minutes * 60 + seconds
@emberian
emberian / foo.coffee
Created March 13, 2012 02:03 — forked from anonymous/gist:2026105
a guest on Mar 12th, 2012 - pastebin.com/QAzuZUDr
response_handler = (response)=>
buf = null
ptr = 0
response.on "data", (chunk) =>
if not buf
if response.headers['content-length']
buf = new Buffer(parseInt(response.headers['content-length'],10)+2)
else
buf = ''
@emberian
emberian / BXscGvpi
Created March 25, 2012 20:25 — forked from anonymous/BXscGvpi
a guest on Mar 25th, 2012 - -.- ?
function lastElement(array) {
if (array.length > 0)
return array[array.length - 1];
else
return null;
}
show(lastElement([1, 2, null]));
@emberian
emberian / aEFVTHdB
Created April 7, 2012 16:31 — forked from anonymous/aEFVTHdB
a guest on Apr 7th, 2012 - SVetter
$.ajax({
type: "POST",
url: "meta-parse.php",
data: $('input.#url').serialize(),
success: function(data) {
var json = $.parseJSON(data);
var images = json.images.split(',');
$('#url_preview').html("<div id='message'></div>");
$('#url_preview').toggle();
$('#add_process_board_picker').toggle();
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct
{ unsigned long length
; char *data
;
} String;
>>> def generate(startdate, recipients, daycount, message):
... last_date = startdate
... mail = email.message_from_string(message)
... msg_lib = []
... for i in range(0, daycount):
... for recep in range(len(recipients)):
... mail['date'] = email.utils.formatdate(time.mktime(last_date.utctimetuple()))
... msg_lib.append(mail)
... last_date = last_date + datetime.timedelta(days=1)
... return msg_lib
import maildb
import email
import time
import datetime
def genarate(STARTDATE, RECIPIENTS, DAYCOUNT, MESSAGE):
last_date = STARTDATE
mail = email.message_from_string(MESSAGE)
msg_lib = []
i = 0
>>>>> def tetra(x, y):
c = x ** x
print c
>>> tetra(3, 3)
27
>>> tetra(2, 5)
4
>>> tetra(2, 3)
4
data = """
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243