Skip to content

Instantly share code, notes, and snippets.

View soharu's full-sized avatar

오자현 / Jahyun Oh soharu

View GitHub Profile
(define H 300)
(define r (/ H 2))
(define (ypos x)
(if (<= x 1)
(/ (sqrt (- 1 (sqr (- (* 2 x) 1)))) 2)
(/ (sqrt (- 1 (sqr (- (* 2 x) 3)))) -2)))
(define (ypos-as-posn x)
(make-posn (* x r)
(* (+ 1 (ypos x)) r)))
@kconragan
kconragan / keyrepeat.shell
Last active December 4, 2023 03:40
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@falsetru
falsetru / submit.py
Last active December 13, 2015 11:38
submit solution to algospot judge.
#!/usr/bin/env python
import cookielib
import os
from contextlib import closing
import re
import getpass
import webbrowser
import sys
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active October 9, 2023 12:15
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@lattner
lattner / TaskConcurrencyManifesto.md
Last active March 26, 2024 00:33
Swift Concurrency Manifesto
@jdmcd
jdmcd / API.swift
Last active June 19, 2020 07:37
Alamofire + Codable
class API {
static let apiKey = "test"
static let baseUrl = ""
enum Endpoint {
case login
case register
var endpoint: String {
switch self {