Skip to content

Instantly share code, notes, and snippets.

View OndrejSlamecka's full-sized avatar

Ondřej Slámečka OndrejSlamecka

View GitHub Profile
@gizmaa
gizmaa / Plot_Examples.md
Last active April 12, 2024 14:18
Various Julia plotting examples using PyPlot
@dg
dg / websocket.html
Created August 11, 2013 15:54
WebSocket communication between PHP and single client
<!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) {
@fprochazka
fprochazka / BasePresenter.php
Created October 6, 2012 16:22
Image pipe for #nettefw templates
<?php
/**
* @author Filip Procházka <filip@prochazka.su>
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Img\ImagePipe
@Mikulas
Mikulas / Google.php
Created August 21, 2012 13:21
GoogleAuth
<?php
use \Nette\Utils\Json;
/**
* Minimalistic Google OAuth2 connector
* @author Mikuláš Dítě
* @license BSD-3
*/
class Google extends Nette\Object
@NoxArt
NoxArt / gist:2692147
Created May 14, 2012 06:21
JavaScript Undo/Redo
###
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
@dg
dg / fibonacci.js
Last active October 2, 2015 23:07
Fibonacci number benchmark
// 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);
}
@Yavari
Yavari / README.markdown
Created February 23, 2012 09:00 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # 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
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # 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
@danhixon
danhixon / folderizer
Created January 3, 2012 18:17
create yyyy-mm folders for your photos
# 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(' ','\ ')
@tonious
tonious / hash.c
Last active February 17, 2023 02:25
A quick hashtable implementation in c.
/* 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>