Skip to content

Instantly share code, notes, and snippets.

View knowbody's full-sized avatar
🏠
Yolo.

Mateusz Zatorski knowbody

🏠
Yolo.
View GitHub Profile
@ijt
ijt / http_get.go
Last active August 23, 2021 12:37
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@aheckmann
aheckmann / storeImgInMongoWithMongoose.js
Created April 17, 2012 19:14
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@staltz
staltz / introrx.md
Last active May 23, 2024 07:49
The introduction to Reactive Programming you've been missing
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@ains
ains / index.html
Created March 31, 2015 13:40
Code for "Things Which Aren't Magic - JSONP"
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
var GaugeWrapper = React.createClass({
componentDidMount(){
var target = React.findDOMNode(this)
var gauge = new Gauge(target).setOptions(this.props.options);
gauge.maxValue = this.props.max;
gauge.set(this.props.value);
},
render(){
return <canvas width={this.props.width} height={this.props.height} />
}
@mnot
mnot / snowden-ietf93.md
Last active September 12, 2023 13:40
Transcript of Edward Snowden's comments at IETF93.