Skip to content

Instantly share code, notes, and snippets.

<?php
function pc_permute($items, $perms = array( )) {
if (empty($items)) {
$res = $perms[0] + 13.0 * $perms[1] / $perms[2] + $perms[3] + 12.0 * $perms[4] - $perms[5] - 11.0 + $perms[6] * $perms[7] / $perms[8] - 10.0;
if ($res == 66.0) {
print join(' ', $perms) . ": $res\n";
}
} else {
for ($i = count($items) - 1; $i >= 0; --$i) {
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-z': 'unset!'
'body':
'ctrl-alt-o': 'unset!'
'ctrl-alt-s': 'unset!'
// ==UserScript==
// @name Bidding Status
// @namespace leafnode
// @include http://allegro.pl/myaccount/bid.php
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// ==/UserScript==
jQuery('#items-list tbody tr').each( function ( i ) {
// ==UserScript==
// @name Allegro Watchlist reminders
// @namespace leafnode
// @description Add button to enable reminders on all auctions
// @include http://allegro.pl/myaccount/watch.php
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// ==/UserScript==
int wyswietl_menu( )
{
int ch;
cout << "\n 1. Wyszukiwanie ksiazek" << endl;
cout << " 2. Edycja danych" << endl;
cout << " 3. Dopisywanie danych" << endl;
cout << " 4. Wypożyczanie książek" << endl;
cout << " 5. Zwrot książek" << endl;
cout << " 6. Koniec\n\n";
cout << "Wybierz polecenie: \n? ";
diff --git a/blipalacz.user.js b/blipalacz.user.js
index e781177..fba42b1 100644
--- a/blipalacz.user.js
+++ b/blipalacz.user.js
@@ -775,6 +775,19 @@ function Dopal() {
}
}
} else {
+
+ jQuery('span.respond').each(function(e, v){
@leafnode
leafnode / getYoutubeId.php
Created September 12, 2015 19:30
Get YouTube ID from URL
<?php
public static function getYoutubeId($url)
{
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match))
{
return $match[1];
} else {
return false;
}
}
import re
a = u'Brzozowa 4/5'
re.split('\W+',a, re.UNICODE)
# [u'Brzozowa', u'4', u'5']
a = u'Drzymały 4/5'
re.split('\W+',a, re.UNICODE)
# chce: [u'Drzymały', u'4', u'5']
# dostaję: [u'Drzyma', u'y', u'4', u'5']
@leafnode
leafnode / gist:1284186
Created October 13, 2011 13:16
jQuery snippet for ZendCon timetable
$jq('input.customtimetable').click( function (e) { if ($jq(this).is(':checked') ) { $jq(this).parent().css('background', '#10a010'); } else { $jq(this).parent().css('background', '#E6E7E9'); } } );
@leafnode
leafnode / gist:3272149
Created August 6, 2012 08:01
Parse date
<?php
$str = "Mon Aug 06 00:00:00 BST 2012";
$d = strtotime("$str");
echo date("Y-m-d H:i", $d);
// 2012-08-06 01:00