Skip to content

Instantly share code, notes, and snippets.

View gubi's full-sized avatar

Alessandro Gubitosi gubi

View GitHub Profile
@cv711
cv711 / gist:5875299
Last active April 15, 2023 07:01
SPARQL queries to get the names of cities of the world, based on population from Wikipedia
-- just the city resource
SELECT DISTINCT ?citylabel ?countrylabel ?pop
WHERE {
?city rdf:type dbpedia-owl:City.
?city rdfs:label ?citylabel.
?city dbpedia-owl:country ?country.
?country rdfs:label ?countrylabel.
?city dbpedia-owl:populationTotal ?pop .
FILTER ( lang(?countrylabel) = 'en' and lang(?citylabel) = 'en' and ?pop>10000)
@toshimaru
toshimaru / jquery-scroll-bottom.js
Last active March 25, 2026 00:25
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@koenpunt
koenpunt / chosen-bootstrap.css
Last active December 17, 2025 18:08
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@carlj
carlj / rsa-encryption.md
Last active February 28, 2020 07:01
RSA large File En- and Decryption

RSA File De- and Encryption

Docu for encrypt and decrypt a large file with AES and RSA

Keypairs

Generate RSA Keypairs

//generates a private Key with 8196 Bit. 
openssl genrsa -out private.pem 8196
@marek-saji
marek-saji / dev-tld.md
Last active September 27, 2025 02:50
Configure local DNS server to serve #dev #TLD #ubuntu #linux

Configure local wildcard DNS server

  1. Install Dnsmasq: sudo apt-get install dnsmasq
  2. Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo restart network-manager.
  3. Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=127.0.0.1.
  4. Create a new file in /etc/dnsmasq.d (eg. /etc/dnsmasq.d/dev), and add the line address=/dev/127.0.0.1 to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart.

source: http://brunodbo.be/blog/2013/04/setting-up-wildcard-apache-virtual-host-wildcard-dns

@justinstern
justinstern / wc-pdf-product-vouchers-custom-fields.php
Last active May 2, 2017 20:40
Sample code demonstrating how to create custom voucher fields for with the WooCommerce PDF Product Vouchers plugin
<?php
// Put the following in your theme's functions.php for instance:
add_filter( 'wc_pdf_product_vouchers_voucher_fields', 'wc_pdf_product_vouchers_add_custom_fields', 10, 2 );
/**
* Adds some custom fields to the given product voucher
*
@staydecent
staydecent / styles.less
Last active June 4, 2021 04:44
Smaller, more compact tab-bar for Atom.io
.tab-bar {
height: 34px;
padding: 0;
.tab {
-webkit-transform: none;
top: 2px;
line-height: 25px;
&.active {
@wgh000
wgh000 / province.php
Last active May 18, 2021 15:52
Province Italia - Array PHP
<?php
$province= array(
'AG' => 'Agrigento',
'AL' => 'Alessandria',
'AN' => 'Ancona',
'AO' => 'Aosta',
'AR' => 'Arezzo',
'AP' => 'Ascoli Piceno',
'AT' => 'Asti',
'AV' => 'Avellino',
@gubi
gubi / Atom_packages.md
Last active May 13, 2022 13:20
Packages installed in Atom

Featured

  • Autocomplete
  • Autocomplete Plus
  • Zen
  • Color Picker
  • Linter
  • Linter Php
  • Linter csslint
  • Linter Jshint
  • Linter Jsonlint
@malteo
malteo / gist:d7bb8eb835be9b734fc2
Created October 20, 2014 11:19
HTML select per le province italiane raggruppate per regione
<select>
<optgroup label="Piemonte">
<option value="TO">Torino</option>
<option value="VC">Vercelli</option>
<option value="NO">Novara</option>
<option value="CN">Cuneo</option>
<option value="AT">Asti</option>
<option value="AL">Alessandria</option>
<option value="BI">Biella</option>
<option value="VB">Verbano-Cusio-Ossola</option>