Skip to content

Instantly share code, notes, and snippets.

View corydolphin's full-sized avatar

Cory Dolphin corydolphin

View GitHub Profile
# Libraries Included:
# Numpy, Scipy, Scikit, Pandas
import re
from itertools import chain
from sets import Set
from itertools import islice
def chunk(it, size):
it = iter(it)
return iter(lambda: tuple(islice(it, size)), ())
inputs = '''
My parents impressed on me the value of that you work hard for what you want in life. That your word is your bond and you do what you say and keep your promise. That you treat people with respect. Show the values and morals in in the daily life. That is the lesson that we continue to pass on to our son.
We need to pass those lessons on to the many generations to follow. [Cheering] Because we want our children in these nations to know that the only limit to your achievement is the strength of your dreams and your willingness to work for them.
My parents impressed on me the value of that you work hard for what you want in life. That your word is your bond and you do what you say and keep your promise. That you treat people with respect. Show the values and morals in in the daily life. That is the lesson that we continue to pass on to our son.
We need to pass those lessons on to the many generations to follow. [Cheering] Because we want our children in these nations to know that the only limit to your achievement is the strength of your dreams and your willingness to work for them.
[FBSDKAppEvents logEvent:FBSDKAppEventNameAddedToCart
valueToSum:54.23
parameters:@{ FBSDKAppEventParameterNameCurrency : @"USD",
FBSDKAppEventParameterNameContentType : @"shoes",
FBSDKAppEventParameterNameContentID : @"HDFU-8452" } ];
@corydolphin
corydolphin / digits_login_button.coffee
Created February 27, 2015 04:03
A simple React component for Digits Login
React = require 'react'
Request = require 'superagent'
Digits = require 'sdk'
Digits.init(consumerKey:"3evG1ZwmgzY2FiJ1NihrbfqSt")
DigitsLoginButton = React.createClass
propTypes:
userUpdated: React.PropTypes.func.isRequired
componentDidMount: ()->
@corydolphin
corydolphin / mongoengine_jsonencoder.py
Last active August 9, 2021 17:57
Fix: TypeError: ObjectId is not JSON serializable: A Flask JSONEncoder for Mongoengine documents. Specifically useful for use with Flask-Mongoengine.
from flask import Flask
from flask.json import JSONEncoder
from bson import json_util
from mongoengine.base import BaseDocument
from mongoengine.queryset.base import BaseQuerySet
class MongoEngineJSONEncoder(JSONEncoder):
def default(self,obj):
if isinstance(obj,BaseDocument):
return json_util._json_convert(obj.to_mongo())
/* Example code for Software Systems at Olin College.
Copyright 2014 Allen Downey
License: Creative Commons Attribution-ShareAlike 3.0
*/
#include "stdio.h"
/*
Exam 2
Cory dolphin
*/
#include "stdio.h"
#include "stdlib.h" // we need malloc!
/* Exam 2
Cory dolphin
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
< /*
< Exam 2
< Cory dolphin
---
> /* Example code for Software Systems at Olin College.
>
> Copyright 2014 Allen Downey
> License: Creative Commons Attribution-ShareAlike 3.0
9d9
< #include "stdlib.h" // we need malloc!