Skip to content

Instantly share code, notes, and snippets.

set -e
set -x
cd $HOME
rm -rf netstack.bare netstack
git clone --bare $HOME/gvisor netstack.bare
cd netstack.bare
import functools
import logging
import os
import struct
from typing import Dict, cast, Optional, List
import cytoolz
from trio.hazmat import wait_readable
import inotify_simple
import trio
View same_site.go
package main
import (
// Don’t send `SameSite=None` to known incompatible clients.
func shouldSendSameSiteNone(useragent string) (bool, error) {
sameSiteNoneIncompatible, err := isSameSiteNoneIncompatible(useragent)
eh-dub / index.d.ts
Last active Jun 10, 2021
Sapper + Svelte + Typescript
View index.d.ts
// in $PROJECT_ROOT/typings/@sapper
declare module '@sapper/app' {
// from sapper/runtime/src/app/types.ts
// sapper doesn't export its types yet
interface Redirect {
statusCode: number
location: string
// end
shamrin / ffmerge
Last active Dec 9, 2016
ffmerge and ffrebase: merge in fast-forward-only single-commit workflow
View ffmerge
#!/usr/bin/env fish
set branch (git symbolic-ref -q --short HEAD)
or exit 1
if test $branch = "master"
echo "error: can't ffmerge master to master, switch to feature branch first"
exit 2
View TableSort.elm
import Html exposing (..)
import Html.Events exposing (onClick)
import StartApp.Simple exposing (start)
-- Generic
type alias HeadItem a =
{ sorter: (a -> a -> Basics.Order)
, toHtml : (a -> Html)

Суть бага в Webpack v1.12.11

Шаг 1

Есть модуль A, который импортирует модуль B В процессе первого(!) импорта модуля B происходит его инициализация, которая в коде вебпака происходит следующим образом:

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
View opinion.html
<!DOCTYPE html>
<meta charset="UTF-8">
.article {
margin: 25px;
color: #333;
font: georgia, serif;
View wait-google-sent-me.js
var active = false;
function changeRefer(details) {
if (!active) return;
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'Referer') {
details.requestHeaders[i].value = '';
View gist:6a38c2a2b2185977b3cb
document.write("<script src=''>\x3c/script>");
!window.jQuery && document.write("<script src=''>\x3c/script>");
startime = (new Date).getTime();
var count = 0;
function unixtime() {
var a = new Date;
return Date.UTC(a.getFullYear(), a.getMonth(), a.getDay(), a.getHours(), a.getMinutes(), a.getSeconds()) / 1E3
url_array = ["", ""];