Run using the explorer, here.
First Page:
query {
topic(name: "go") {
repositories(first: 100, orderBy: {field: STARGAZERS, direction:DESC}) {
edges {
node {
<?xml version="1.0" encoding="UTF-8" ?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="text" encoding="utf-8"/> | |
<xsl:template match="/*[node()]"> | |
<xsl:text>{</xsl:text> | |
<xsl:apply-templates select="." mode="detect" /> | |
<xsl:text>}</xsl:text> | |
</xsl:template> | |
package main | |
import "golang.org/x/tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
p := make([][]uint8, dy) | |
for y := range p { | |
p[y] = make([]uint8, dx) | |
for x := 0; x < dx; x++ { | |
p[y][x] = uint8(x^y) |
Run using the explorer, here.
First Page:
query {
topic(name: "go") {
repositories(first: 100, orderBy: {field: STARGAZERS, direction:DESC}) {
edges {
node {
If you've made a wrong forceful push or just want to recover from old commits in github, then you can use this command flow:
# find the commit, just like git reflog
curl -u <username> https://api.github.com/repos/:owner/:repo/events
# create a new branch from the commit sha found in previous step
curl -u <github-username>
-X POST -d ‘{“ref”:”refs/heads/<new-branch-name>”, “sha”:”<sha-from-step-1>"}’
https://api.github.com/repos/:owner/:repo/git/refs
package dao | |
import ( | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
"gopkg.in/mgo.v2" | |
"strings" | |
"log" | |
) |
Audio compression is used to reduce the dynamic range of a recording. Dynamic range is the difference between the loudest and softest parts of an audio signal. It was originally used to guard against defects when cutting wax and vinyl phonograph records, but generally became useful as a way of increasing the loudness of an audio recording without achieving distortion.
The goal of most compression applications is to increase the amplitude of the softest parts of a recording, without increasing the amplitude of the loudest parts.
Compressors generally all have the same conceptual parts. However, not all compressors present variable controls for all parts to the user. If you don't see all of your compressor's controls here, there's a chance it either has a fixed value (and no control), or is named something else:
// https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3 | |
package main | |
import ( | |
"fmt" | |
) | |
const ( | |
Mercury = 3.303e+23 | |
Venus = 4.869e+24 |
// declare constants for the days in a week, and assign to them | |
// different numeric values. | |
// | |
// so, they won't clash. if both values of Sunday and Monday were 0, | |
// then, how could we know that which one is Sunday or Monday? | |
// | |
// this code is for this article: https://blog.learngoprogramming.com/golang-const-type-enums-iota-bc4befd096d3 | |
const ( | |
Sunday = 0 | |
Monday = 1 |
/* | |
non-refactored, hacky tool to extract interfaces. | |
adopted from https://github.com/campoy/justforfunc/tree/master/24-ast | |
*/ | |
package main | |
import ( | |
"fmt" | |
"go/scanner" | |
"go/token" |
#!/bin/bash | |
# ----------------------------------------------------------------------------- | |
# HOW TO RUN? | |
# ----------------------------------------------------------------------------- | |
# . ./godev.bash | |
# WARNING: | |
# |