Skip to content

Instantly share code, notes, and snippets.

@paralin
paralin / nilref.go
Created November 28, 2018 21:09
GopherJS compiler error with var _ context.Context = nil
package nilref
import (
"context"
)
// Setting a reference to nil in a variable causes the following GopherJS error:
/*
0 *ast.AssignStmt {
1 . Lhs: []ast.Expr (len = 1) {
@paralin
paralin / SETUP.md
Created October 25, 2017 01:41
How to set up spacemacs as a desktop environment

XSession File

To add emacs to your login screen, add this file to /usr/share/xsessions/emacs.desktop:

[Desktop Entry]
Encoding=UTF-8
Exec=/usr/local/bin/startspacemacs
DesktopNames=EMacs
Name=SpaceMacs
@paralin
paralin / Godeps.json
Created September 19, 2017 22:39
Working GoDeps for client-go for kubernetes
{
"ImportPath": "github.com/myuser/myproject",
"GoVersion": "go1.9",
"GodepVersion": "v79",
"Packages": [
"./..."
],
"Deps": [
{
"ImportPath": "github.com/PuerkitoBio/purell",
@paralin
paralin / panic.log
Created September 13, 2017 20:17
Kernel panic on Odroid HC1
-- Logs begin at Thu 2016-11-03 13:16:44 EDT, end at Thu 2016-11-03 13:17:19 EDT. --
Nov 03 13:16:44 skiff-21fac66 systemd-journald[427]: Time spent on flushing to /var is 5.146ms for 0 entries.
Nov 03 13:16:44 skiff-21fac66 kernel: Booting Linux on physical CPU 0x100
Nov 03 13:16:44 skiff-21fac66 kernel: Linux version 4.9.47 (paralin@ember) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 SMP PREEMPT Wed Sep 13 14:45:27 EDT 2017
Nov 03 13:16:44 skiff-21fac66 kernel: CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=30c5387d
Nov 03 13:16:44 skiff-21fac66 kernel: CPU: div instructions available: patching division code
Nov 03 13:16:44 skiff-21fac66 kernel: CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Nov 03 13:16:44 skiff-21fac66 kernel: OF: fdt:Machine model: Hardkernel Odroid XU4
Nov 03 13:16:44 skiff-21fac66 kernel: cma: Reserved 128 MiB at 0x00000000b6800000
Nov 03 13:16:44 skiff-21fac66 kernel: Memory policy: Data cache writealloc
ReadCommand: TS3, <nil>
ReadCommand: Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command., <nil>
wrote: use port=9987
ReadCommand: error id=0 msg=ok, <nil>
wrote: login serveradmin 0E6KVh2Q
ReadCommand: error id=0 msg=ok, <nil>
wrote: clientlist -uid
ReadCommand: clid=18 cid=1 client_database_id=1 client_nickname=serveradmin\sfrom\s127.0.0.1:39686 client_type=1 client_unique_identifier=serveradmin, <nil>
ReadCommand: error id=0 msg=ok, <nil>
client list: "[{\"Id\":18,\"DatabaseId\":1,\"Nickname\":\"serveradmin from 127.0.0.1:39686\",\"Type\":1}]"
@paralin
paralin / 1_GraphQL.md
Last active July 3, 2018 19:28
GraphQL @defer, @LiVe, @stream implementation notes

Notes moved from graph-gophers/graphql-go#15

Graphql-js can parse directives like @live just fine -

parsed.definitions[0].selectionSet.selections[0].selectionSet.selections[0].directives[0] =
{ kind: 'Directive',
  name: { kind: 'Name', value: 'live', loc: { start: 26, end: 30 } },
  arguments: [],
 loc: { start: 25, end: 30 } }
@paralin
paralin / changes
Created December 19, 2016 19:03
Someone disconnecting when loading in
Begin Differences (1 differences):
Types [CSODOTALobby,null], Item Expected != Actual, Values (Dota2.GC.Dota.Internal.CSODOTALobby,(null))
End Differences (Maximum of 2147483647 differences shown).
Begin Differences (1 differences):
Types [List`1,List`1], Item Expected.members.Count != Actual.members.Count, Values (12,11)
End Differences (Maximum of 2147483647 differences shown).
Begin Differences (1 differences):
@paralin
paralin / changes
Created December 15, 2016 17:13
Someone leaving lobby before loading in
Begin Differences (6 differences):
Types [UInt64,UInt64], Item Expected.lobby_id != Actual.lobby_id, Values (24859523222192297,24859523214019320)
Types [List`1,List`1], Item Expected.members.Count != Actual.members.Count, Values (3,2)
Types [UInt64,UInt64], Item Expected.members[1].id != Actual.members[1].id, Values (76561198039543567,76561198303265427)
Types [DOTA_GC_TEAM,DOTA_GC_TEAM], Item Expected.members[1].team != Actual.members[1].team, Values (DOTA_GC_TEAM_BAD_GUYS,DOTA_GC_TEAM_PLAYER_POOL)
Types [String,String], Item Expected.members[1].name != Actual.members[1].name, Values (Oipipi,FACEIT Lobby Dumper)
Types [UInt32,UInt32], Item Expected.members[1].slot != Actual.members[1].slot, Values (1,0)
End Differences (Maximum of 2147483647 differences shown).
@paralin
paralin / theme.css
Last active December 15, 2016 18:54
Jenkins theme
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$='blue.png']{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20height%3D%2218%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2218%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23009688%22%20d%3D%22M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202zm-2%2015l-5-5%201.41-1.41L10%2014.17l7.59-7.59L19%208l-9%209z%22%2F%3E%3C%2Fsvg%3E)}[src$='red.png']{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20height%3D%2218%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2218%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%23F44336%22%20d%3D%22M12%202C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010
@paralin
paralin / code.js
Last active February 2, 2016 20:10
Reverse engineering the DOTA2 Watch tab.
var strBaseImageURL = "http://cdn.dota2.com/apps/dota2/images/";
var rgHeroData = {
"1": {
"key": "antimage",
"id": 1,
"name": "npc_dota_hero_antimage",
"portait": "antimage",
"attrgroup": "agi",
"roles": {
"Carry": "2",