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},
@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 \

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 / delete_data.rb
Created April 22, 2014 22:53
Give an App ID and the master token - delete's all users and optionally all app data as well.
#
# Requires you to run 'gem install httparty'
#
require 'httparty'
def main
appId = ARGV[0]
masterKey = ARGV[1]
delete_data = ARGV[2] ? ARGV[2] == "true" : false
// header.h
@interface CMTestEncoderNSCoding : NSObject <NSCoding>
@property (nonatomic, copy) NSString *aString;
@property (nonatomic, assign) NSInteger anInt;
@end
@interface CMTestEncoderNSCodingParent : CMObject
Process: Xcoverage [9811]
Path: /Applications/Xcoverage.app/Contents/MacOS/Xcoverage
Identifier: com.MattRajca.Xcoverage
Version: 1.0.5 (8)
Code Type: X86-64 (Native)
Parent Process: launchd [148]
Responsible: Xcoverage [9811]
User ID: 501
Date/Time: 2014-04-18 13:07:48.222 -0400
@ethanmick
ethanmick / 2048.applescript
Last active August 29, 2015 13:57
A script to play 2048 on Chrome.
activate application "Google Chrome"
delay 1.0 -- time to release modifier keys if the script is run with a keyboard shortcut
tell application "System Events"
repeat 100 times
set rand to (random number from 123 to 126)
key code rand
delay 0.2
end repeat
end tell