Skip to content

Instantly share code, notes, and snippets.

View ethanmick's full-sized avatar
🐺
Hello!

Ethan Mick ethanmick

🐺
Hello!
View GitHub Profile
@ethanmick
ethanmick / route.ts
Created February 24, 2023 14:53
Next.js App API Route
import { prisma } from '@/lib/db'
import { NextResponse } from 'next/server'
export async function GET(request: Request) {
console.log('** GET /books')
const books = await prisma.book.findMany()
return NextResponse.json(books)
}
export async function POST(request: Request) {
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},

Keybase proof

I hereby claim:

  • I am ethanmick on github.
  • I am ethanmick (https://keybase.io/ethanmick) on keybase.
  • I have a public key ASC51TgU3L5pj5QUGXYWQvmVGgH6mnByjlMze9_AMe4C0wo

To claim this, I am signing this object:

@ethanmick
ethanmick / MDColor.swift
Created January 28, 2017 17:27
A quick way to get all of Material Design's colors into your Swift app. These can be combined into a single file if you want.
import Foundation
import UIKit
struct MDColor {
static let red = redColorPallete()
static let pink = pinkColorPallete()
static let purple = purpleColorPallete()
'use strict';
class Test {
constructor(opts = {}) {
// NOTE: No Semicolon at the end of this line
const example = JSON.parse(opts.example)
({
id: this.id,
@ethanmick
ethanmick / install_pygit2.sh
Last active June 20, 2016 19:19
Install pygit2 on Ubuntu 16.04. Can be used as a vagrant shell provision with the raw url.
sudo apt-get update
sudo apt-get install \
python-dev \
libffi-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
libssh2-1 \
libgit2-dev \
@ethanmick
ethanmick / Game.m
Created January 4, 2014 16:30
Loading the Menu from Cocos2D
- (void)openMenu:(CCMenuItem *)item;
{
// UI KITTTTTTTTTT
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"DMMainMenu_iPhone" bundle:nil];
UIViewController *menu = [storyboard instantiateViewControllerWithIdentifier:@"DMMainMenuNavigationController"];
menu.modalPresentationStyle = UIModalPresentationFullScreen;
menu.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
if (menu) {
[[CCDirector sharedDirector] presentViewController:menu animated:YES completion:^{
[[CCDirector sharedDirector] pause];
@ethanmick
ethanmick / KPUser.h
Created April 18, 2013 18:30
Persisting a CMUser subclass.
//
// KPUser.h
// Header File
//
#import <CloudMine/CloudMine.h>
@interface KPUser : CMUser
@property (nonatomic, copy) NSString *firstName;
81883A97-D747-42C9-A005-136F44B0A2DC - String file contents
b0d5853a-7265-4de6-9121-058d2f7eca93 - String file contents