Skip to content

Instantly share code, notes, and snippets.

View RusAlex's full-sized avatar

Alexander Pletnev RusAlex

View GitHub Profile
/*eslint-env node */
var Koa = require('koa');
var fetch = require('node-fetch');
var app = new Koa();
app.use(function *() {
var that = this;
fetch('https://api.github.com/users/github')
.then(function(res) {
return res.json();
@RusAlex
RusAlex / README.md
Last active January 27, 2016 06:38 — forked from jmarceli/README.md
React errors explained

1

You will get one of these:

Uncaught (in promise) TypeError: Cannot read property 'toUpperCase' of undefined(…)

ReactCompositeComponent.js:870 Uncaught TypeError: Cannot read property 'displayName' of undefined

if you try to:

import React, { Component } from 'react';
class Foo extends Component
{
onChangeSelect = () => {
};
render() {
"babel": {
"optional": [
"es7.functionBind",
"es7.classProperties",
"es7.decorators"
]
},
language: node_js
node_js:
- "4.2"
services:
- postgresql
env:
- CXX=g++-4.8
{
"name": "libertysoil",
"version": "1.0.0",
"description": "Libertysoil.org website",
"license": "AGPL-3.0+",
"repository": {
"type": "git",
"url": "git+https://github.com/Lokiedu/libertysoil-site.git"
},
"main": "index.js",
<?php
$link = mysql_connect('localhost', '', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db('yiitest', $link) or die('Could not select database.');
$res = mysql_query("SELECT id, val FROM bit_values", $link );
while($row = mysql_fetch_assoc($res)) {
var_dump($row);
<?php
$pdo = new PDO(
'mysql:host=localhost;dbname=yiitest',
'',
''
);
$sth = $pdo->prepare("SELECT * FROM bit_values");
$sth->execute();
$r = $sth->fetchAll(PDO::FETCH_ASSOC);
echo '<pre>'; var_dump($r); echo '</pre>'; die();
<?php
$link = mysqli_connect("localhost","","","yiitest") or die("Error " . mysqli_error($link));
$query = "SELECT id,val FROM bit_values" or die("Error in the consult.." . mysqli_error($link));
$result = $link->query($query);
//display information:
while($row = mysqli_fetch_array($result)) {
var_dump($row);
<?php
namespace tests\codeception\unit\models;
/**
*
* CREATE table user (
* id int unsigned primary key auto_increment,
* test bit(1) NOT NULL
* ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
*/