Skip to content

Instantly share code, notes, and snippets.

@berinle
berinle / gist:1487328
Created December 16, 2011 18:38
Textmate 2 (custom bundles)
cd ~/Library/Application\ Support
mkdir -p Avian/"Pristine Copy"/Bundles
cd Avian/Pristine\ Copy/Bundles
#clone groovy bundle
git clone https://github.com/textmate/groovy.tmbundle.git
#clone grails bundle
git clone https://github.com/textmate/groovy-grails.tmbundle.git
@PrimaryFeather
PrimaryFeather / Polygon.h
Last active December 16, 2015 01:09
An example for a custom display object for the Sparrow Framework.
#import "SPDisplayObject.h"
@interface Polygon : SPDisplayObject
- (id)initWithRadius:(float)radius numEdges:(int)numEdges color:(uint)color;
- (id)initWithRadius:(float)radius numEdges:(int)numEdges;
@property (nonatomic, assign) int numEdges;
@property (nonatomic, assign) float radius;
@property (nonatomic, assign) uint color;
@walkermatt
walkermatt / fizzbuzz.clj
Last active July 12, 2017 14:08
fizzbuzz without conditionals in Clojure
;; fizzbuzz without conditionals in Clojure
; Simple patten matching using a single map lookup
(defn fizzbuzz [x]
(let [v [(= (mod x 3) 0) (= (mod x 5) 0)]]
({[true false] "fizz"
[false true] "buzz"
[true true] "fizzbuzz"
[false false] x} v)))
@dougireton
dougireton / recruiter_response.md
Last active January 11, 2020 22:52
I've started responding to recruiters with this list of requirements

Company Requirements

I'm definitely not looking for work. However to provide some helpful guidance for hiring like-minded engineers, I would only consider working for a company if it met these requirements:

  1. Fewer than 250 employees.
  2. Concrete, measurable plan to increase the number of women and minorities in engineering roles.
  3. Commitment to using and contributing to open source.
  4. Collaborative, friendly atmosphere where pair programming is encouraged.
  5. Meaningful work with clear linkage between work and company goals.
  6. Demonstrated commitment to ethical business practices, e.g. B corp certification.
@calebd
calebd / ArrayHelpers.swift
Last active November 4, 2022 15:17
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@denji
denji / README.md
Last active January 30, 2024 12:21 — forked from istepanov/gist:3950977
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,