Skip to content

Instantly share code, notes, and snippets.

View onegrx's full-sized avatar

Bartłomiej Szałach onegrx

  • Kraków, Poland
View GitHub Profile
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import scala.collection.JavaConversions._
import java.net.{ URL, MalformedURLException }
import scala.util.control.Exception._
sealed case class Link(title: String, href: String)
@onegrx
onegrx / 0.md
Created May 16, 2016 01:43 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@onegrx
onegrx / preprocessor_fun.h
Created April 18, 2016 21:24 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@onegrx
onegrx / hello-latex.tex
Created March 9, 2016 14:36 — forked from wbzyl/hello-latex.tex
Szablon LateX-a dla ShareLaTeX
\documentclass[12pt,a4paper,polish]{article}
\usepackage{polski}
\usepackage[utf8]{inputenc}
\begin{document}
\section{Tytuł}
Uwaga na znaki specjalne!
@onegrx
onegrx / web-servers.md
Created January 10, 2016 21:41 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@onegrx
onegrx / absurd_rest_service.js
Created November 15, 2015 12:07 — forked from tomekc/absurd_rest_service.js
Before running, install express by running npm install express and run with: node absurd_rest_service.js in this script's directory. Then: To submit calculation to curl -i -H "Content-Type: application/json" -d '{ "operation" : "+", "operands" : [ 2,3] }' http://localhost:3000/calculations To see results, use link from response: curl http://loca…
/*
Before running, install express by running
npm install express
and run with:
node absurd_rest_service.js
in this script's directory.