Skip to content

Instantly share code, notes, and snippets.

Avatar

Cory Dolphin corydolphin

View GitHub Profile
View Day4
# 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 = '''
View Speech.txt
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.
View Melania Trump Speech Republican National Convention 2008
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.
View Facebook.m
[FBSDKAppEvents logEvent:FBSDKAppEventNameAddedToCart
valueToSum:54.23
parameters:@{ FBSDKAppEventParameterNameCurrency : @"USD",
FBSDKAppEventParameterNameContentType : @"shoes",
FBSDKAppEventParameterNameContentID : @"HDFU-8452" } ];
@corydolphin
corydolphin / digits_login_button.coffee
Created Feb 27, 2015
A simple React component for Digits Login
View digits_login_button.coffee
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 Aug 9, 2021
Fix: TypeError: ObjectId is not JSON serializable: A Flask JSONEncoder for Mongoengine documents. Specifically useful for use with Flask-Mongoengine.
View mongoengine_jsonencoder.py
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())
View gist:10398262
/* Example code for Software Systems at Olin College.
Copyright 2014 Allen Downey
License: Creative Commons Attribution-ShareAlike 3.0
*/
#include "stdio.h"
View vector.c
/*
Exam 2
Cory dolphin
*/
#include "stdio.h"
#include "stdlib.h" // we need malloc!
View matrix.c
/* Exam 2
Cory dolphin
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
View example.diff
< /*
< 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!