Skip to content

Instantly share code, notes, and snippets.

View krzysztofjeziorny's full-sized avatar

Krzysztof Jeziorny krzysztofjeziorny

View GitHub Profile
@krzysztofjeziorny
krzysztofjeziorny / print.less
Created June 12, 2013 08:10
@media print less for the Omega 3 based Drupal subtheme
/* print */
@media print {
* {
text-shadow: none !important;
color: #000 !important; // Black prints faster: h5bp.com/s
background: transparent !important;
box-shadow: none !important;
}
@krzysztofjeziorny
krzysztofjeziorny / video-rwd
Created June 19, 2013 10:08
Elastic videos for responsive web design
video {
max-width: 100%;
height: auto;
}
.video { /* container div for iframes <div class="video"><iframe/></div> */
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
@krzysztofjeziorny
krzysztofjeziorny / bootstrap3-modal
Created July 15, 2013 10:08
Bootstrap 3 modal example
<a data-toggle="modal" href="#myModal" class="btn btn-primary">Launch modal</a>
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<?php
// *********** Print $fields array to investigate which field content are problematic
print_r($fields);
// Build the SQL.
if (empty($primary_keys)) {
// We are doing an insert.
$options = array('return' => Database::RETURN_INSERT_ID);
?>
@krzysztofjeziorny
krzysztofjeziorny / .asoundrc
Created October 1, 2013 20:18
.asoundrc file for my Raspberry Pi giving output to the USB sound card with a Toslink output
pcm.!default { type hw card 0 }
ctl.!default { type hw card 0 }
pcm_slave.sl2 { pcm "hw:0,0" rate 48000 }
pcm.rate_convert { type rate slave sl2 }

Keybase proof

I hereby claim:

  • I am travellersam on github.
  • I am konsonantenboy (https://keybase.io/konsonantenboy) on keybase.
  • I have a public key ASDtTgEqXk92Dj8bj4VQGqZy7PpCJqRUxkLJdK2E2n_5YQo

To claim this, I am signing this object:

@krzysztofjeziorny
krzysztofjeziorny / Apache cache-control for Service Worker file
Last active September 7, 2018 13:58
Apache conf/htaccess for setting Cache-Control option for service worker file
<IfModule mod_headers.c>
<filesmatch "sw.js">
Header set Cache-Control "max-age=0, private"
</filesmatch>
</IfModule>
Check with:
curl -I -L http://www.example.com/sw.js
@krzysztofjeziorny
krzysztofjeziorny / gulpfile.js
Created November 5, 2018 15:06
gulp scss workflow for styles and service worker w/ sw-precache
// Define dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var nano = require('gulp-cssnano');
var parker = require('gulp-parker');
var run = require('gulp-run');
const workboxBuild = require('workbox-build');
// Compile sass to compressed css andd add vendor prefixes
@krzysztofjeziorny
krzysztofjeziorny / django-wagtail-apache_vhost.conf
Created November 27, 2018 09:22
A sample Apache vHost configuration file for a Django/Wagtail project
# A sample Apache vHost configuration file
# Source: http://grimnes.no/blog/how-easily-deploy-wagtail-website/
<VirtualHost *:80>
ServerName www.example.com # your domain name
ServerAlias example.com *.example.com
Define project_name some_project_name #
Define user the_username # who owns the project? /home/the_username/..
@krzysztofjeziorny
krzysztofjeziorny / hp-proliant-support-pack.list
Last active December 3, 2018 16:59
HP Enterprise apt repository for Debian 9/Stretch
Use script https://downloads.linux.hpe.com/SDR/add_repo.sh (wget, chmod +x, run) or add manually:
vim /etc/apt/sources.list.d/HP-mcp.list
# HPE Management Component Pack
# Latest, here for Debian stretch:
deb http://downloads.linux.hpe.com/SDR/repo/mcp stretch/current non-free
# for Gen9 and older, use 10.xx dist:
deb http://downloads.linux.hpe.com/SDR/repo/mcp stretch/10.62 non-free