Skip to content

Instantly share code, notes, and snippets.

View gist:33896
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? ";
View blipalacz-kontynuuj.patch
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){
View gist:612960
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 Oct 13, 2011
jQuery snippet for ZendCon timetable
View gist:1284186
$jq('input.customtimetable').click( function (e) { if ($jq(this).is(':checked') ) { $jq(this).parent().css('background', '#10a010'); } else { $jq(this).parent().css('background', '#E6E7E9'); } } );
View gist:3272149
<?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
@leafnode
leafnode / fujarka.sh
Created Aug 13, 2012
Measure your dick length based on your server's parameters
View fujarka.sh
#!/bin/sh
export LC_ALL=C
echo `uptime|grep days|sed 's/.*up \([0-9]*\) day.*/\1\/10+/'; cat /proc/cpuinfo|grep MHz|awk '{print $4"/30 +";}'; free|grep '^Mem' |awk '{print $3"/1024/3+"}'; df -P -k -x nfs | grep -v 1k | awk '{if ($1 ~ "/dev/(scsi|sd)"){ s+= $2} s+= $2;} END {print s/1024/50"/15+70";}'`|bc|sed 's/\(.$\)/.\1cm/'
View gist:3339937
<meta property="og:title" content="Fota bimbałów" />
<meta property="og:image" content="http://example.com/cycki.jpg" />
<meta property="og:image:width" content="598" />
<meta property="og:image:height" content="743" />
<meta property="og:description" content="Fajne bimbały" />
@leafnode
leafnode / gist:4441994
Last active Dec 10, 2015 — forked from anonymous/gist:4356672
Fetch all books from Wolne Lektury
View gist:4441994
import simplejson, requests, urllib, re
# -*- encoding: utf-8 -*-
from slughifi import slughifi
### http://trac.django-fr.org/browser/site/trunk/project/links/slughifi.py?rev=47
### with django's slugify hardcoded inside from:
### http://code.activestate.com/recipes/577257/
for z in simplejson.loads(requests.get("http://wolnelektury.pl/api/books/").content.decode('utf8')):
p = simplejson.loads(requests.get(z['href']).content)
View Gemfile
source :rubygems
# gem "rails", "2.3.14"
# gem "i18n", "~> 0.4.2"
# gem "coderay", "~> 1.0.6"
# gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
# gem "tzinfo", "~> 0.3.31"
# Optional gem for LDAP authentication
# group :ldap do
View vmware9.k3.8rc4.patch
--- vmci-only/linux/driver.c 2012-08-16 05:53:18.000000000 +1000
+++ vmci-only3.8rc4/linux/driver.c 2013-01-23 11:19:10.325897824 +1100
@@ -124,7 +124,7 @@
.name = "vmci",
.id_table = vmci_ids,
.probe = vmci_probe_device,
- .remove = __devexit_p(vmci_remove_device),
+ .remove = vmci_remove_device,
};