Skip to content

Instantly share code, notes, and snippets.

@stroum
stroum / index.html
Last active December 19, 2017 14:09
Go Long Polling
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
function lp() {
var http = new XMLHttpRequest();
http.open('GET', '/lp', true);
http.onreadystatechange = function(event) {
alias l='ls -CFa'
export GOPATH=~/go
export PATH="$PATH:$GOPATH/bin"
export GOARCH=arm
export GOARM=7
export CGO_ENABLED=1
export GOOS=linux

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

/*
The MIT License (MIT)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
@stroum
stroum / vibrator.cpp
Last active December 13, 2023 15:03
C++ XInput Vibrator
/*
The MIT License (MIT)
Copyright (c) 2015 Alexander Rizaev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@stroum
stroum / paint.html
Last active November 22, 2017 07:42
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Паинт для бомжей</title>
<style>
* { padding: 0; margin: 0; }
body { padding: 10px; }
canvas { padding: 5px; border: 1px solid #ccc;}
@stroum
stroum / jquery.js
Last active April 2, 2019 13:24
bidlokod
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.construc
@stroum
stroum / .vimrc
Last active August 13, 2020 21:29
my .vimrc
set mouse=r
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Plugin list
Plugin 'VundleVim/Vundle.vim'