Skip to content

Instantly share code, notes, and snippets.

View breakerh's full-sized avatar

Bram Hammer breakerh

View GitHub Profile
@breakerh
breakerh / 0_reuse_code.js
Created March 25, 2014 22:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@breakerh
breakerh / javascript_resources.md
Created March 25, 2014 22:00 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@breakerh
breakerh / css_resources.md
Created March 25, 2014 22:00 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@breakerh
breakerh / Popup_chat.meta.js
Created August 21, 2014 17:06
Popup Chat V0.3.2
// ==UserScript==
// @name Popup Chat
// @namespace ssm
// @description Instead of an in screen chat, pop it allllll up!
// @include http://*.grepolis.*/game*
// @version 0.3.2
// @grant none
// @downloadURL https://www.slingshotmedia.nl/Popup_chat.user.js
// @updateURL https://www.slingshotmedia.nl/Popup_chat.meta.js
// ==/UserScript==
<div class="soi_facebook openup">
<div class="content">
<div data-show-border="false" data-stream="true" data-header="false" data-show-faces="true" data-colorscheme="light" data-height="395" data-width="300" data-href="https://www.facebook.com/showoffimports" class="fb-like-box fb_iframe_widget" fb-xfbml-state="rendered" fb-iframe-plugin-query="app_id=403798313116572&amp;color_scheme=light&amp;container_width=295&amp;header=false&amp;height=395&amp;href=https%3A%2F%2Fwww.facebook.com%2Fshowoffimports&amp;locale=en_GB&amp;sdk=joey&amp;show_border=false&amp;show_faces=true&amp;stream=true&amp;width=300"><span style="vertical-align: bottom; width: 300px; height: 395px;"><iframe width="300px" height="395px" frameborder="0" name="f2ca45e514e83d" allowtransparency="true" allowfullscreen="true" scrolling="no" title="fb:like_box Facebook Social Plugin" style="border: medium none; visibility: visible; width: 300px; height: 395px;" src="http://www.facebook.com/v2.0/plugins/like_box.php?app_id=403798313116572&amp;cha
2017-02-09T13:15:13+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: carfitment
2017-02-09T13:15:13+00:00 INFO (6): TURPENTINE: -- block testing: shouldResponseUseEsi = 1
2017-02-09T13:15:13+00:00 INFO (6): TURPENTINE: -- block testing: instanceof Mage_Core_Block_Template =
2017-02-09T13:15:13+00:00 INFO (6): TURPENTINE: -- block testing: Esi Options = Array
(
[access] => private
[scope] => page
[ttl] => 0
[flush_events] => Array
(
@breakerh
breakerh / video-onend.js
Created January 21, 2021 23:42
Video on end close elementor popup
let video = document.getElementById('popupVideo');
let closebutton = document.querySelector('.closebutton');
//no idea what the actual elementor popup close button for class has....
video.onended = function (){
closebutton.click();
/**
* This works since it's not a
* link and has an event listener
*/
@breakerh
breakerh / ytvideo-end.js
Created January 22, 2021 00:00
Elementor popup yt video end
// make sure your yt video has 'enablejsapi=1' in the url
let video = false;
function onYouTubePlayerAPIReady() {
video = new YT.Player('popupVideo', {
events: {
'onStateChange': ShowMe
}
});
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">productaddons_options_form.options_form_data_source</item>
<item name="deps" xsi:type="string">productaddons_options_form.options_form_data_source</item>
</item>
<item name="label" xsi:type="string" translate="true">Option Form</item>
<item name="layout" xsi:type="array">
<item name="type" xsi:type="string">tabs</item>
@breakerh
breakerh / javascript.html
Created July 16, 2021 10:40
Add fading background on body in Elementor Pro
<script type="text/javascript">
let faders = [...document.querySelectorAll('section[data-background]')].reverse();
function Utils() {
}
Utils.prototype = {
constructor: Utils,
isElementInView: function (element, fullyInView) {
var pageTop = jQuery(window).scrollTop();
var pageBottom = pageTop + jQuery(window).height();