Skip to content

Instantly share code, notes, and snippets.

View alper's full-sized avatar
Always coffee

Alper Cugun alper

Always coffee
View GitHub Profile
@nasser
nasser / meshes.clj
Created November 15, 2014 00:36
pure functional composable mesh generation
(import Selection MeshFilter Vector3 Mesh Mathf)
(use 'clojure.repl)
;; mesh updates
(defn update-mesh! [^MeshFilter mf vs tris]
(set! (.. mf mesh vertices)
(into-array Vector3 vs))
(set! (.. mf mesh triangles)
(into-array System.Int32 tris)))
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active November 30, 2022 09:27
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

127.0.0.1 aachener-zeitung.de
127.0.0.1 a-beig.de
127.0.0.1 abendblatt.de
127.0.0.1 abendzeitung.de
127.0.0.1 aerztezeitung.de
127.0.0.1 alfelder-zeitung.de
127.0.0.1 aller-zeitung.de
127.0.0.1 allgaeuer-anzeigeblatt.de
127.0.0.1 allgemeine-zeitung.de
127.0.0.1 all-in.de
@praeclarum
praeclarum / SimplifiedPolyline.cs
Created November 27, 2012 21:04
A simplified polyline that has only enough line segments to accurately represent the original polyline.
//
// Copyright 2012 Frank A. Krueger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@cjohansen
cjohansen / gist:4135065
Created November 23, 2012 10:43
Naming this in nested functions

tl;dr

If you must nest functions in a way that requires access to multiple this', alias outer this to something meaningful - describe the value it's holding. Treat this as the invisible first argument.

In general though, avoiding the situation (nested functions and frivolous use of this) will frequently produce clearer results.

Naming this in nested functions

I was accidentally included in a discussion on how to best name this in nested functions in JavaScript. +1's were given to this suggestion of using _this.

Giving style advice on naming nested this without a meaningful context isn't too helpful in my opinion. Examples below have been altered to have at least some context, although a completely contrived and stupid one.