Skip to content

Instantly share code, notes, and snippets.

Avatar

Paolo Priotto depoulo

View GitHub Profile
@depoulo
depoulo / JSunconf15notes.md
Last active Aug 29, 2015
JS Unconf 2015 notes
View JSunconf15notes.md
View gist:a03395c351ddbe277f9f
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
cinst 7zip.install
cinst classic-shell
cinst Console2
cinst curl
cinst dropbox
cinst fiddler4
cinst Firefox
cinst flashplayerplugin
@depoulo
depoulo / console-paste-styles.js
Last active May 22, 2017
Add CSS rules quickly from the browser JS console. Idea taken from http://davidwalsh.name/add-rules-stylesheets
View console-paste-styles.js
(() => {
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
var rules = prompt('Paste CSS rules here');
var importStatements = (rules.split(';') || []).filter(s => s.startsWith('@import')).map(s => s + ';');
importStatements.forEach((importStatement, index) => style.sheet.insertRule(importStatement, index));
style.sheet.insertRule(`@media all{${rules}`, importStatements.length);
}())
@depoulo
depoulo / gif.php
Last active Sep 24, 2019
Get random gif from Giphy - might be against their TOS, please check yourself and use reasonably - I use it for our continuos integration status monitor, which of course is almost never red ;)
View gif.php
// get random image from Giphy
function getRandomGif($topic = 'fail') {
$data = file_get_contents("http://giphy.com/search/$topic");
preg_match_all('@href="/gifs/(.*?)"@', $data, &$matches);
$gifId = $matches[1][array_rand($matches[1])];
return "http://media2.giphy.com/media/$gifId/giphy.gif";
}
@depoulo
depoulo / dabblet.css
Created Feb 26, 2014
Attempt for Essen & Trinken small stage teasers
View dabblet.css
/**
* Attempt for Essen & Trinken small stage teasers
*/
* { padding: 0; margin: 0; }
body { padding: 2%; max-width: 25em; font-family: Verdana; } a { color: black; text-decoration: none; }
.left { float: left; }
.right { float: right; }
.left, .right {
@depoulo
depoulo / dabblet.css
Created Dec 1, 2013
What exactly do you mean by "dotted"?
View dabblet.css
/**
* What exactly do you mean by "dotted"?
*/
i {
border-width: 10px;
border-color: peachpuff;
border-style: dotted;
border-radius: 150px;
@depoulo
depoulo / dabblet.css
Created Jul 15, 2013
What exactly do you mean by "dotted"?
View dabblet.css
/**
* What exactly do you mean by "dotted"?
*/
i {
border-width: 10px;
border-color: peachpuff;
border-style: dotted;
border-radius: 150px;
@depoulo
depoulo / dabblet.css
Created Jul 15, 2013 — forked from LeaVerou/dabblet.css
CSS Puzzle: Reverse the z-order of the <li>s without setting a separate z-index on each one in a way that works in IE9 and up
View dabblet.css
/**
* CSS Puzzle: Reverse the z-order of the <li>s without setting a separate z-index on each one in a way that works in IE9 and up
*/
li {
list-style: none;
display: inline-block;
padding: 1em 2em 1em 1em;
border: 1px solid rgba(0,0,0,.3);
border-radius: 0 999px 999px 0;
@depoulo
depoulo / gist:5832073
Last active May 15, 2019
CSS-only multi-line ellipsis with generated content. License: http://www.wtfpl.net/txt/copying/
View gist:5832073
@import "compass/css3/images";
// CSS-only multi-line ellipsis with generated content
// yields `position:relative`, so remember to declare an eventual `position:absolute/fixed` *after* including this mixin
@mixin limitLines(
$maxLinesPortrait, // Mandatory: The number of lines after which the clipping should take action.
$maxLinesLandscape: $maxLinesPortrait, // You may provide a different line limit for landscape orientation.
// Note that 'portrait' is our default orientation. However, if you omit $maxLinesLandscape,
// the value of $maxLinesPortrait is used for whatever orientation (that is, without a media query).