- Download the installer from the page https://golang.org/dl/ and install the package.
Type go
in terminal, to verify the installation.
- Create a Go workspace and set GO PATH
def nine_slice sprite | |
x = sprite.x | |
y = sprite.y | |
w = sprite.w | |
h = sprite.h | |
path = sprite.path | |
t_x = sprite.tile_x | |
t_y = sprite.tile_y | |
o_w = sprite.tile_w | |
o_h = sprite.tile_h |
module GTK | |
class Runtime | |
def draw_circle c | |
radius = c.radius.to_i || 0 | |
xc = c.x.to_i + radius | |
yc = c.y.to_i + radius | |
t = c.thickness || 1 | |
r = c.r || 0 | |
g = c.g || 0 | |
b = c.b || 0 |
class ApplicationJob < ActiveJob::Base | |
around_perform do |job, block| | |
Honeycomb.start_span(name: job.class.name) do |span| | |
span.add_field 'type', 'worker' | |
span.add_field 'queue.name', job.queue_name | |
block.call | |
end | |
end | |
end |
// Package main is a sample macOS-app-bundling program to demonstrate how to | |
// automate the process described in this tutorial: | |
// | |
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
// | |
// Bundling the .app is the first thing it does, and creating the DMG is the | |
// second. Making the DMG is optional, and is only done if you provide | |
// the template DMG file, which you have to create beforehand. | |
// | |
// Example use: |
Type go
in terminal, to verify the installation.
#!/usr/bin/ruby | |
# some fish! | |
fish = %w{ fish fish2 fish3 fish4 fish5 fish6 fish7 } | |
# At least 3 lines | |
lines = rand(4) + 3 | |
output = "" |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
package { | |
import starling.core.Starling; | |
import starling.animation.Transitions; | |
import starling.animation.Tween; | |
public class Utils { | |
// This function accepts an originalX and originalY so that you can shake things that | |
// are on screen but not necessarily originally located at 0, 0 (compared to the original | |
// implementation which only ever moved things back to 0, 0) | |
public static function screenShake(drawable:Shakeable, shakeDuration:Number, intensity:Number, originalX:Number, originalY:Number):void { |
#!/usr/bin/env ruby | |
require 'socket' | |
require 'openssl' | |
module Foo | |
end | |
OpenSSL::SSL::SSLSocket.prepend(Foo) | |
# This line crashes with the prepend() but works without it |
I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).