Skip to content

Instantly share code, notes, and snippets.

View braska's full-sized avatar

Danil Agafonov braska

  • Diligent Corporation
  • Vancouver, Canada
  • 14:22 (UTC -07:00)
View GitHub Profile
@braska
braska / build.gradle
Created February 17, 2016 19:46
Spring example gradle config
buildscript {
ext {
springBootVersion = '1.4.0.BUILD-SNAPSHOT'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
@braska
braska / index.html
Last active January 15, 2016 19:21
Canvas Lukeboard
<html>
<head>
<meta charset="utf-8"/>
<title>HTML5 Canvas Drawing Board</title>
<script type="text/JavaScript" src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
/**
* Automatically applies "p" and "br" markup to text.
* Basically [nl2br](http://php.net/nl2br) on steroids.
*
* echo Text::auto_p($text);
*
* [!!] This method is not foolproof since it uses regex to parse HTML.
*
* @param string $str subject
* @param boolean $br convert single linebreaks to <br />