Skip to content

Instantly share code, notes, and snippets.

View rnarian's full-sized avatar
😱
It's complicated

Marian Friedmann rnarian

😱
It's complicated
View GitHub Profile
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

mymodule {
@at-root {
.#{&}-header { ... }
.#{&}-footer { ... }
.#{&}-body {
a { ... }
span { ... }
p { ... }
}
}
@jjmu15
jjmu15 / has_class.js
Created January 27, 2014 10:08
has class function - vanilla JS. Check if element has specified class
// hasClass, takes two params: element and classname
function hasClass(el, cls) {
return el.className && new RegExp("(\\s|^)" + cls + "(\\s|$)").test(el.className);
}
/* use like below */
// Check if an element has class "foo"
if (hasClass(element, "foo")) {
@samrocketman
samrocketman / gitlab_gemoji.patch
Created April 8, 2014 22:45
Revert GitLab back to gemoji
diff --git a/Gemfile b/Gemfile
index 195de7b..84bb745 100644
--- a/Gemfile
+++ b/Gemfile
@@ -164,7 +164,7 @@ gem "jquery-ui-rails", "2.0.2"
gem "raphael-rails", "~> 2.1.2"
gem 'bootstrap-sass', '~> 3.0'
gem "font-awesome-rails", '~> 3.2'
-gem "gitlab_emoji", "~> 0.0.1.1"
+gem "gemoji", "~> 1.3.0"
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@paulirish
paulirish / what-forces-layout.md
Last active July 24, 2024 03:23
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@frdmn
frdmn / checker.sh
Last active September 30, 2015 10:28
El Capitan availability checker - read the installation instructions in the bash script below
#!/usr/bin/env bash
# Installation instructions:
# $ curl -s https://gist.githubusercontent.com/frdmn/c6700ade5a0fc906271f/raw/checker.sh > /usr/local/bin/osx-checker
# $ chmod +x /usr/local/bin/osx-checker
# $ osx-checker
URL="https://itunes.apple.com/search?entity=macSoftware&term=OS+X"
SEARCH_STRING="OS X El Capitan"
TIMEOUT_IN_SECONDS="60"