Skip to content

Instantly share code, notes, and snippets.

View Nonemoticoner's full-sized avatar

Nonemoticoner

  • Kraków, Poland
View GitHub Profile
@Nonemoticoner
Nonemoticoner / url-template.txt
Created March 26, 2017 16:38
JetBrains DataGrip PostgreSQL Driver URL template for Heroku Postgres URI Database Credentials
postgres://{user:param}:{password:param}@{host::localhost}:{port::5432}/{database::postgres}
@Nonemoticoner
Nonemoticoner / README.md
Created November 13, 2016 16:19 — forked from joyrexus/README.md
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

var express = require('express');
var bodyParser = require('body-parser');
var app =express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));
app.post('/video', function(req, res) {
@Nonemoticoner
Nonemoticoner / source.cpp
Created December 17, 2015 22:25
Quadratic function
#include <iostream>
#include <math.h>
using namespace std;
int main(){
double a = 1, b = 1, c = 1;
if(b*b-4*a*c < 0)
cout << "No solution!" << endl;
@Nonemoticoner
Nonemoticoner / Links.md
Last active February 11, 2016 21:25
List of useful links with computer science resources
@Nonemoticoner
Nonemoticoner / TablicewC++.md
Last active August 29, 2015 14:13
Tablice w C++

Tablice w C++

Wprowadzenie

Czasami chcemy posiadać wiele zmiennych, by zapisać w nich np. wyniki jakichś pomiarów. Tworzenie pojedynczych zmiennych dla każdego pomiaru byłoby niezwykle czasochłonne, a także uciązliwe w użyciu. Na pomoc przychodzą nam tablice. Jest to najzwyczajniej wiele zmiennych tego samego typu, do których odnosimy się za pomocą indeksu. Przykładowo mogę utworzyć tablicę typu int, która będzie przechowywać 10 zmiennych:

int tab[10];

Do poszczególnych zmiennych odnosimy się w bardzo prosty sposób tj:

@Nonemoticoner
Nonemoticoner / main.cpp
Created June 10, 2014 11:46
Point, Line, Curve classes
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
class point{
public:
double x, y; //tip of line

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@Nonemoticoner
Nonemoticoner / gist:5663395
Created May 28, 2013 15:01
HTML: Starting file
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
@Nonemoticoner
Nonemoticoner / PHP: Detect IE
Last active December 17, 2015 19:49 — forked from krazylegz/gist:703428
PHP: Detect IE
<?php // SEE IF THE BROWSER BEING USED IS INTERNET EXPLORER
function ae_detect_ie()
{
if (isset($_SERVER['HTTP_USER_AGENT']) &&
(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
return true;
else
return false;
}
?>