Skip to content

Instantly share code, notes, and snippets.

View petrov82's full-sized avatar

Peter Rhodes petrov82

View GitHub Profile
@thanhminhmr
thanhminhmr / README.md
Last active December 9, 2025 15:23
Go doesn't have ternary, so created one...

go-ternary

Yes, I know—yet another attempt at bringing a ternary-like experience to Go. But hey, Go doesn’t have one, and I wasn’t around when the last million were written.

Why?

Because Go doesn't have a ternary operator, and according to the official FAQ, it likely never will. The reasoning? To prevent developers from writing "impenetrably complex expressions." But let's be real—poor coding practices exist in all forms. Instead of outright banning a useful construct, wouldn’t compiler warnings for overly complicated ternary expressions have been a more reasonable approach?

Since that's not happening, here’s go-ternary—because sometimes, a one-liner is just nicer than an if-else.

@icemancast
icemancast / elaine.php
Last active August 29, 2015 14:05
Elaine Likes Me Alot
<?php
// Remember the class is aware.
// ==========================
function askElaine() {
echo 'Do you like me yes || no!' . PHP_EOL;
}
function doesLikeMe() {
echo 'I just want to be friends!' . PHP_EOL;
@iambibhas
iambibhas / scopes.txt
Last active January 25, 2025 20:07
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@andrewonj
andrewonj / README.md
Created August 30, 2012 15:56 — forked from sosedoff/opentable_client.rb
OpenTable API Client

Unofficial OpenTable API

This project was created for one purpose — to make OpenTable data easily accesible to developers. No longer do you have to download XLS file, parse it and insert into your app's database. That shit is annoying.

It is absolutely free and open for everyone to use.

Created by @dan_sosedoff while drinking beers with @alwaysunday in Austin, TX.

Usage