Skip to content

Instantly share code, notes, and snippets.

@karlseguin
karlseguin / fakeresponse.go
Created March 10, 2013 12:51
A fake http.ResponseWriter class, used for testing. See http://openmymind.net/Testing-In-Go/
package fakeresponse
import (
"testing"
"net/http"
)
type FakeResponse struct {
t *testing.T
headers http.Header
@soheilhy
soheilhy / nginxproxy.md
Last active October 23, 2024 08:19
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@thom-nic
thom-nic / Dockerfile
Created June 18, 2014 15:15
Node.js Dockerfile based on ubuntu 14.04. This is a little smaller than dockerfile/nodejs which depends on python
# Node.js app Docker file
FROM ubuntu:14.04
MAINTAINER Thom Nichols "[email protected]"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get -qq update
RUN apt-get install -y nodejs npm
@AntoineAugusti
AntoineAugusti / limitConcurrentGoroutines.go
Last active July 30, 2024 17:58
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
@Restuta
Restuta / framework-sizes.md
Last active September 19, 2024 15:32
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@joyrexus
joyrexus / README.md
Last active August 6, 2024 16:07
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@sadovnik
sadovnik / nvim-python-match-tag-always.md
Last active April 19, 2021 05:09
neovim nvim MatchTagAlways error fix

If you get this error when open neovim:

$ nvim

MatchTagAlways unavailable: requires python.
Press ENTER or type command to continue

Try to install neovim package:

@muka
muka / install-protoc.sh
Last active March 20, 2018 14:04
How to install protoc to use with grpc
#Get a release here https://github.com/google/protobuf/releases
sudo -s
cd /usr/local/include
mkdir google
wget https://github.com/google/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip -O protoc.zip
unzip protoc.zip -d tmp
Getting started:
1. Follow this tutorial: https://github.com/AssemblyScript/assemblyscript/wiki/Hello-World to get your environment setup
2. Change the scripts section of your package.json to the one provided in this gist (the only real difference is the --use abort= tag).
3. Use the module.ts provided in this gist for your module source (in the assembly directory).
4. "npm run build" will create your binaries (perhaps you have to mkdir build first though).
5. Uploading to eos requires an abi file, using one of another contract is completely fine though, as our contract does not use any action data.
=> After uploading the abi together with build/untouched.wasm you can push an action to your contract and Hello, World! will be printed.