Skip to content

Instantly share code, notes, and snippets.

@jonahglover
jonahglover / PHP_semantics.md
Created February 1, 2018 17:07 — forked from jameshfisher/PHP_semantics.md
Semantics for PHP

PHP semantics

Motivation

PHP is usually included in the top five or six most popular programming languages, as measured by various metrics implemented by e.g. [Tiobe][], [LangPop][], [PYPL][], [lang-index][]. Alongside it sit C, Java, Obj-C, C++, C#, Javascript, and Python. All of these have a formal semantics or at least a rigorous specification.

@jonahglover
jonahglover / PHP_semantics.md
Created February 1, 2018 17:07 — forked from jameshfisher/PHP_semantics.md
Semantics for PHP

PHP semantics

Motivation

PHP is usually included in the top five or six most popular programming languages, as measured by various metrics implemented by e.g. [Tiobe][], [LangPop][], [PYPL][], [lang-index][]. Alongside it sit C, Java, Obj-C, C++, C#, Javascript, and Python. All of these have a formal semantics or at least a rigorous specification.

@jonahglover
jonahglover / GIF-Screencast-OSX.md
Created May 19, 2017 20:24 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jonahglover
jonahglover / GIF-Screencast-OSX.md
Created May 19, 2017 20:24 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jonahglover
jonahglover / GIF-Screencast-OSX.md
Created May 19, 2017 20:24 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jonahglover
jonahglover / message.rb
Created May 9, 2016 22:16
message unique open rate
def unique_open_rate
recipient_activities = recipient_messages.joins(:activities)
((recipient_activities.where("activities.activity_type = 'open'").distinct.count.to_f / recicipient_messages.count) * 100).round(2)
end
query
user.messages.select("messages.*,
COUNT(DISTINCT recicipient_messages.id) recipient_count,
COUNT(DISTINCT activities.id) total_activities,
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
)
/*
sample json