Skip to content

Instantly share code, notes, and snippets.

View czterystaczwarty's full-sized avatar

Tomasz Szopiński czterystaczwarty

View GitHub Profile
@czterystaczwarty
czterystaczwarty / gist:5138183
Created March 11, 2013 21:57
temporary link to mysql socket file
ln -s /Applications/xampp/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock
@czterystaczwarty
czterystaczwarty / svn-remove.sh
Last active December 9, 2015 19:48
Recursively delete .svn directories
rm -rf `find . -type d -name .svn`
# or
find . -name '.svn'|xargs rm -rf
@czterystaczwarty
czterystaczwarty / update_select.sql
Last active October 13, 2015 01:28
Update with subselect on the same table.
UPDATE
   product
SET
   product_active = 0, product_date_deleted = NOW()
WHERE product_id IN (SELECT product_id
   FROM (SELECT
         product.product_id
       FROM
           product
       LEFT JOIN
@czterystaczwarty
czterystaczwarty / gist:4113270
Created November 19, 2012 19:44
Custom responsive navigation
/* small screens */
@media screen and (max-width: 44em) {
html,
body {
margin:0;
}
nav[role="custom-dropdown"] {
ul {
display:none;
@czterystaczwarty
czterystaczwarty / facebook_like-box_responsive.css
Created October 29, 2012 23:43 — forked from smeranda/facebook_like-box_responsive.css
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@czterystaczwarty
czterystaczwarty / icmp.php
Created October 22, 2012 13:16 — forked from spiechu/icmp.php
Class ICMPPing constructs raw ICMP echo packet, sends it and echoes the response
<?php
// See the corresponding blog entries (in Polish):
// http://spiechu.pl/2012/05/16/tworzenie-pakietow-icmp-w-php
// http://spiechu.pl/2012/05/26/w-miare-bezpieczne-uruchamianie-skryptow-php-poprzez-shell_exec
class ICMPPing
{
const TYPE_REQUEST = 0x08;
const TYPE_RESPONSE = 0x00;
@czterystaczwarty
czterystaczwarty / _media-queries.scss
Created October 19, 2012 20:29 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
@czterystaczwarty
czterystaczwarty / gist:3860413
Created October 9, 2012 18:08
minimal html5 page
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>awesome first page</title>
</head>
<body>
<script type="text/javascript">
@czterystaczwarty
czterystaczwarty / index.html
Created September 27, 2012 09:09 — forked from alexrinass/index.html
XHTML Base Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>Untitled</title>
<link rel="stylesheet" href="/stylesheets/screen.css" type="text/css" media="screen,projection" />