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
template <template <class> class C, typename T> | |
bool contains(C<T> container, T item) { | |
return std::find(container.begin(), container.end(), item) != container.end(); | |
} |
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
var jQuery = require('jquery'); | |
/* | |
* Yellow Text - v0.5.0 | |
* Yellow Text is a beautiful text editor which makes creating content fun again. It ships with a beautiful theme and really clever shortkeys. | |
* https://github.com/stefanvermaas/yellow-text | |
* | |
* Made by Stefan Vermaas | |
* Under BEERWARE License | |
*/ |
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 | |
/** | |
* TexyCache - class for caching Texy! results | |
* ------------------------------------------- | |
* | |
* Using Texy! the great web text markup-language processor by David Grudl (http://davidgrudl.com) | |
* For more information please visit http://texy.info | |
* | |
* @author Ondrej Slamecka, 2010 | |
* @license New BSD license (see http://texy.info/en/licence) |
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
/** | |
* Returns styleProperty of given element | |
*/ | |
function getStyle(el, styleProperty) | |
{ | |
if (el.currentStyle) | |
return el.currentStyle[styleProperty]; | |
else if (window.getComputedStyle) | |
return document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProperty); | |
} |
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
/* Ondrej Slamecka 2012 */ | |
/** | |
* @param success Callback called on success | |
* @returns bool | |
*/ | |
google.maps.Map.prototype.useGeolocation = function(success, failure) | |
{ | |
if(typeof success === 'undefined') | |
return false; |
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
# DOM Class - based on http://www.openjs.com/scripts/dom/class_manipulation.php | |
class @DomClass | |
this.has = (el, className) -> | |
return el.className.indexOf(className) != -1 | |
this.add = (el, className) -> | |
if !this.has(el, className) | |
el.className += ' ' + className |
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
// ascii85 encoder/decoder prototype | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int ascii85encode(unsigned char *input, char *output) | |
{ | |
size_t inputSize = strlen((char *)input), inputIndex = 0; | |
unsigned int i = 0, j = 0, chunk = 0; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* --- IO --- */ | |
/** | |
* @brief Reads line of text, reallocates memory if needed | |
* @param input | |
* @param size |
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 | |
namespace App; | |
class Mailer | |
{ | |
/** @var \Nette\Mail\IMailer @inject */ | |
public $mailer; |
OlderNewer