Last Update: May 13, 2019
Offline Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<script> | |
if ("WebSocket" in window) { | |
var ws = new WebSocket("ws://127.0.0.1:31339"); | |
ws.onopen = function() { | |
console.log('connected'); | |
}; | |
ws.onerror = function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Filip Procházka <filip@prochazka.su> | |
*/ | |
abstract class BasePresenter extends Nette\Application\UI\Presenter | |
{ | |
/** | |
* @var \Img\ImagePipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use \Nette\Utils\Json; | |
/** | |
* Minimalistic Google OAuth2 connector | |
* @author Mikuláš Dítě | |
* @license BSD-3 | |
*/ | |
class Google extends Nette\Object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Class managing undo/redo | |
### | |
class History | |
### | |
Properties | |
@actions [{name(string), identifier(string), undo(callback), redo(callback)}] | |
@current pointer to a current point in history list, all the lower is history and all the higher ones are future |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fibonacci(40) takes 2 seconds in Node.js 0.6.14 | |
// http://en.wikipedia.org/wiki/Fibonacci_number | |
function fibonacci(n) { | |
return n < 2 ? n : fibonacci(n-2) + fibonacci(n-1); | |
} |
# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Depends on the command line tool: exiftool | |
# brew install exiftool | |
# it also works with mov files if they have | |
# exif data. I know my iPhone adds the exif | |
photos = Dir.glob("*.jpg",File::FNM_CASEFOLD) | |
photos.each do |file_path| | |
file_path = file_path.gsub(' ','\ ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101 | |
* 2017-12-05 | |
* | |
* -- T. | |
*/ | |
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> |
NewerOlder