Skip to content

Instantly share code, notes, and snippets.

:octocat:
...

Michael Gerstmann webdesignberlin

:octocat:
...
Block or report user

Report or block webdesignberlin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mixin-prefix.css
/*
* Mixin for adding vendor prefixes to CSS attributes; useful for the following CSS attributes
*
* - border-radius
* - box-shadow
* - transition
* - background-size
* - box-sizing
* - animate
*
View module-pattern.js
var myNamespace = myNamespace || {};
myNamespace.myFancyModule = (function() {
var self = {},
_ = {};
_.concatString = function(str) {
return 'Hello ' + str;
};
View html5-schema.org-markup.html
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
View screenshot.js
var webdriver = require('selenium-webdriver');
var fs = require('fs');
var driver = new webdriver.Builder().build();
webdriver.WebDriver.prototype.saveScreenshot = function(filename) {
return driver.takeScreenshot().then(function(data) {
fs.writeFile(filename, data.replace(/^data:image\/png;base64,/,''), 'base64', function(err) {
if(err) throw err;
});
View table.css
table { display: table }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }
View douchebag-vertical-align.css
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
View Calendar.js
/*
* Predefined Settings
*/
var model = {
daysObj: {
0: [0,1,2,3,4,5,6],
1: [1,2,3,4,5,6,0],
2: [2,3,4,5,6,0,1],
3: [3,4,5,6,0,1,2],
View gist:1f1078b0812bf5782fee
### Testing if the client is a mobile or a desktop.
### The selection is based on the usual UA strings for desktop browsers.
## Testing a user agent using a method that reverts the logic of the
## UA detection. Inspired by notnotmobile.appspot.com.
map $http_user_agent $is_desktop {
default 0;
~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule
~*spider|crawl|slurp|bot 1; # bots
~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes
View webcomponets.html
<!-- Conditionally load WC polyfills -->
<script>
if ('registerElement' in document
&& 'createShadowRoot' in HTMLElement.prototype
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template')) {
// We're using a browser with native WC support!
} else {
document.write('<script src="/bower_components/webcomponentsjs/webcomponents.js"><\/script>');
}
View gist:30dedb30458ad2186b02
var $ = jQuery;
var $list = $('.topbar__tabs');
var $sections = $('.tabbed-section');
var selected_index = 0;
var $items = $list.children('li');
var $anchors = $list.find('a');
// The setup
You can’t perform that action at this time.