Skip to content

Instantly share code, notes, and snippets.

View kubp's full-sized avatar

Jakub Doležal kubp

View GitHub Profile
@kubp
kubp / gist:bfbfa574f4c0849cad93
Created November 12, 2015 18:05
Node Express 404 handler
app.use(function(req, res, next) {
var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
if (app.get('env') == 'production') {
winston.info("404 - " + fullUrl);
} else {
console.log('\x1b[31m', '404', '\x1b[32m', fullUrl, '\x1b[0m');
}
@kubp
kubp / Sublime
Created December 18, 2015 21:24
{
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"draw_white_space": "all",
"font_face": "Fira Mono",
"font_size": 11,
"ignored_packages":
[
"Vintage"
],
"tab_size": 2,
<!DOCTYPE html>
<html>
<head>
<script>
/* Script written by Adam Khoury @ DevelopPHP.com */
/* Video Tutorial: http://www.youtube.com/watch?v=EraNFJiY0Eg */
function _(el){
return document.getElementById(el);
}
function uploadFile(){
@kubp
kubp / prace_se_soubory.md
Last active March 16, 2016 15:41
Práce se soubory

Soubory a adresáře

Data můžeme ukládat následujícími způsoby

  • Textové soubory sjednoduchou strukturou(.txt, .csv)
  • Textové soubory svnitřní hierarchií(.xml)
  • Soubory binárního typu(otisk paměti do souboru)
  • Databáze

PHP má vynikající možnosti pro manipulaci se soubory. Soubory můžete mazat, vytvářet, kopírovat, načítat atd.

Procházení adresáře

We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 1.
"!Next?" (1994) "!Next?" (1994) 1994-1995
"#1 Single" (2006) "#1 Single" (2006) 2006-????
"#1 Single" (2006) {Cats and Dogs (#1.4)} "#1 Single" (2006) Cats and Dogs (#1.4) 2006
"#1 Single" (2006) {Finishing a Chapter (#1.5)} "#1 Single" (2006) Finishing a Chapter (#1.5) 2006
"#1 Single" (2006) {Is the Grass Greener? (#1.1)} "#1 Single" (2006) Is the Grass Greener? (#1.1) 2006
"#1 Single" (2006) {Stay (#1.8)} "#1 Single" (2006) Stay (#1.8) 2006
"#1 Single" (2006) {The Rules of Dating (#1.3)} "#1 Single" (2006) The Rules of Dating (#1.3) 2006
"#1 Single" (2006) {Timing Is Everything (#1.7)} "#1 Single" (2006) Timing Is Everything (#1.7) 2006
"#1 Single" (2006) {Window Shopping (#1.2)} "#1 Single" (2006) Window Shopping (#1.2) 2006
"#1 Single" (2006) {Wingman (#1.6)} "#1 Single" (2006) Wingman (#1.6) 2006
@kubp
kubp / backup.sh
Created May 25, 2017 19:24
Backup script
#!/bin/bash
d=$(date +%Y_%m_%d)
echo "$d"
echo $1
cd ~/git
for f in *;
do

Keybase proof

I hereby claim:

  • I am kubp on github.
  • I am kubp (https://keybase.io/kubp) on keybase.
  • I have a public key ASBSmrNFbGBZXN7pGy845vN06u1HD8uu0qnyk836jDvFtwo

To claim this, I am signing this object: