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
/** | |
* Same Height, jQuery plug-in. | |
* | |
* This plug-in allows you to automatically have all of the elements marked | |
* with a particular class to be the same height, either by smallest or | |
* largest. | |
* | |
* By default, 'samemaxheight' and 'sameminheight' will be used. | |
* | |
* Examples of use: |
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
if ($('ul.crossfade').length) { | |
$('ul.crossfade').each(function(){ | |
var ul = $(this); | |
if ($('li', ul).length > 1) { | |
$('li:gt(0)', ul).hide(); | |
var fadeSpeed = (ul.attr('data-fadespeed') !== undefined ? ul.attr('data-fadespeed') : 1000); | |
var nextSpeed = (ul.attr('data-nextspeed') !== undefined ? ul.attr('data-nextspeed') : 5000); | |
setInterval(function(){ | |
$('li:first', ul) | |
.fadeOut(fadeSpeed).next('li') |
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 \Zend\Dom\Query; | |
use \Zend\Debug\Debug; | |
/** | |
* Fetch the page source and cache it, ensuring it's saved as UTF-8 | |
* | |
* @param string $url | |
* @return 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
<?php | |
/** | |
* Combine two urls. | |
* | |
* The urls can be either a string or url parts that consist of: | |
* | |
* scheme, host, port, user, pass, path, query, fragment | |
* | |
* If passed in as parts in an array, the query parameter can be either |
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
import RPi.GPIO as GPIO | |
from time import sleep | |
import os | |
from twitter import * | |
from random import choice | |
from datetime import datetime | |
op1 = 11 | |
op2 = 13 |
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
namespace Utils; | |
class Greeting | |
{ | |
protected counter1 = 0; | |
protected counter2 = 0; | |
protected counter3 = 0; | |
protected revcounter1 = 5; | |
protected revcounter2 = 5; | |
protected revcounter3 = 5; |
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 | |
/** | |
* Sort an array of objects. | |
* | |
* Requires PHP 5.3+ to be installed. | |
* | |
* Will use the Intl extension to normalize characters if it's | |
* available. | |
* |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script | |
src="https://code.jquery.com/jquery-3.4.1.slim.min.js" |
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
@echo off | |
SET PhpStormPath=C:\Program Files (x86)\JetBrains\PhpStorm 8.0.2\bin\PhpStorm64.exe | |
echo Adding file entries | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_SZ /v "" /d "Open in PhpStorm" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm" /t REG_EXPAND_SZ /v "Icon" /d "%PhpStormPath%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open in PhpStorm\command" /t REG_SZ /v "" /d "%PhpStormPath% \"%%1\"" /f | |
echo Adding folder entries |
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 | |
function ratio($a, $b) | |
{ | |
$gcd = function($a, $b) use (&$gcd) { | |
return ($a % $b) ? $gcd($b, $a % $b) : $b; | |
}; | |
$g = $gcd($a, $b); | |
return $a/$g . ':' . $b/$g; | |
} |
OlderNewer