Skip to content

Instantly share code, notes, and snippets.

@nikgalushko
nikgalushko / godoc output
Created October 1, 2018 14:05 — forked from cthom06/godoc output
Godoc example
PACKAGE
package example
import "example"
This is the package comment, a top-level piece of documentation
used to explain things about the package (see json or exp/template)
All godoc comments are in this form
with no whitespace between them and what they accompany
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nikgalushko
nikgalushko / custom_json.go
Created December 23, 2016 09:43 — forked from mdwhatcott/custom_json.go
Example of implementing MarshalJSON and UnmarshalJSON to serialize and deserialize custom types to JSON in Go. Playground: http://play.golang.org/p/7nk5ZEbVLw
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
)
func main() {
@nikgalushko
nikgalushko / mgoExample.go
Created December 1, 2016 12:29 — forked from border/mgoExample.go
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
chrome.browserAction.onClicked.addListener(
function(tab) {
var currentURL = tab.url;
if (currentURL.indexOf("gyazo") == -1)
return;
console.log(currentURL.split("/"));
var src = "http://i.gyazo.com/" + currentURL.split("/").pop() + ".png";
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://qps.ru/api?url=" + src + "&format=text", true);
xhr.onreadystatechange = function () {

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
kAudioFormatMPEG4AAC
kAudioFormatAppleLossless
kAudioFormatAppleIMA4
kAudioFormatiLBC
kAudioFormatULaw
kAudioFormatLinearPCM
@nikgalushko
nikgalushko / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------