Skip to content

Instantly share code, notes, and snippets.

View artursopelnik's full-sized avatar
🏠
Working from home

Artur Sopelnik artursopelnik

🏠
Working from home
View GitHub Profile
@artursopelnik
artursopelnik / cookieconsent-create-height-for-fixed-popup.html
Last active July 20, 2018 16:19
Cookie Consent - Create height for fixed popup with vanilla javascript
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function () {
var wrapper = document.body,
cookieBarOptions = {
"palette": {
"popup": {
"background": "#000"
},
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active January 30, 2023 10:58
Die optimale .htaccess-Datei für mehr Speed und Sicherheit
# ----------------------------------------------------------------------
# | Komprimierung und Caching |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#
@hashchange
hashchange / scrollTargetPosition.js
Created August 17, 2015 14:16
Returns the scroll target position for scrolling to the top of an element.
/**
* Returns the scroll target position for scrolling to the top of an element.
*
* Pass the result to a scrollTo method:
*
* - $scrollContainer.scrollTop( result ) for instant scrolling
* - $scrollContainer.scrollTo( result ) for animated scrolling with jQuery.scrollable
*
* @param {jQuery} $target the target element
* @param {jQuery} $scrollContainer either $(window), or a scrollable HTML element
@Kalyse
Kalyse / currencies.php
Created April 28, 2015 15:17
Currencies
[ "AED" => "United Arab Emirates Dirham",
"AFN" => "Afghan Afghani*",
"ALL" => "Albanian Lek",
"AMD" => "Armenian Dram",
"ANG" => "Netherlands Antillean Gulden",
"AOA" => "Angolan Kwanza*",
"ARS" => "Argentine Peso*",
"AUD" => "Australian Dollar",
"AWG" => "Aruban Florin",
"AZN" => "Azerbaijani Manat",
@AmrMekkawy
AmrMekkawy / currency-dropdown-list.html
Last active April 8, 2023 15:03
Currency HTML "select" element (dropdown list)
<select name="">
<option value="USD" selected="selected">United States Dollars</option>
<option value="EUR">Euro</option>
<option value="GBP">United Kingdom Pounds</option>
<option value="DZD">Algeria Dinars</option>
<option value="ARP">Argentina Pesos</option>
<option value="AUD">Australia Dollars</option>
<option value="ATS">Austria Schillings</option>
<option value="BSD">Bahamas Dollars</option>
<option value="BBD">Barbados Dollars</option>
@yaronguez
yaronguez / ACF Country List
Created February 17, 2015 01:37
Country list formatted for Advanced Custom Fields select dropdown
afghanistan : Afghanistan
albania : Albania
algeria : Algeria
american_samoa : American Samoa
andorra : Andorra
angola : Angola
anguilla : Anguilla
antigua_and_barbuda : Antigua and Barbuda
argentina : Argentina
armenia : Armenia
@zoxon
zoxon / data-options.js
Created February 2, 2015 04:48
Convert data-options attribute into an object of key/value pairs
/**
* Convert data-options attribute into an object of key/value pairs
* @private
* @param {String} options Item-specific options as a data attribute string
* @returns {Object}
*/
var getDataOptions = function ( options ) {
var settings = {};
// Trim whitespace from a string
@sheadawson
sheadawson / picturefill.js
Last active April 16, 2019 15:19
picturefill.js + jquery.lazyload
/*
This is a customised version of picturefill.js with the following modifications
1. Before setting the source on the img tag to the appropriate img file, check if the lazyload plugin is defined
2. If so, set the data-original attr of the img instead of the src attr. Also set width and height attrs from the picture span's data-width and data-height attrs.
3. Append the img tag and tell lazyload about it
@connor
connor / .jshintrc.js
Created January 11, 2012 22:20
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php