Skip to content

Instantly share code, notes, and snippets.

(function() {alert("Hi from github gist");
})()
@iris-i
iris-i / SimpleMarquee.js
Created January 8, 2018 21:31
React Marquee using CSS transform
import React from 'react';
import ReactDOM from 'react-dom';
class SimpleMarquee extends React.Component {
constructor(props) {
super(props);
this.state = {
textwidth: 0,
containerwidth: 0,
@iris-i
iris-i / marquee.js
Created January 8, 2018 13:56
React Marquee Component using HTML Canvas & RequestAnimationFrame
import React from 'react';
import ReactDOM from 'react-dom';
class Marquee extends React.Component {
constructor(props){
super(props);
this.state = {
textwidth: 0,
containerwidth: 0,
@iris-i
iris-i / release-management.md
Last active October 29, 2017 23:24 — forked from nerdstein/release-management.md
React Dash release management

This will be a replacement for https://github.com/NuCivic/react-dash/blob/master/docs/development/workflows/publish.md

Dependencies

  1. Set up an account on npm
  2. Get added as maintainer on https://www.npmjs.com/package/react-dash and on the github repository
  3. Identify the next release based on semantic versioning, in the form of x.y.z
  4. Verify you have the appropriate git remotes, both an origin for your fork and an upstream for the React Dash repository
  5. A GPG key setup in github. How to generate a GPG key: https://help.github.com/articles/generating-a-new-gpg-key/
@iris-i
iris-i / DdBaseFirstParagraphFilter.php
Last active October 14, 2022 14:13
Custom Twig Filter for Drupal 8: Gets the first paragraph of a view field as opposed to truncating text at a particular character count
<?php
namespace Drupal\dd_base\TwigExtension;
class DdBaseFirstParagraphFilter extends \Twig_Extension {
/**
* Generates a list of all Twig filters that this extension defines.
*/
public function getFilters() {
@iris-i
iris-i / colorbox-activate.js
Created September 14, 2016 12:49
Making the Colorbox jquery plugin responsive.
/**
* @file
* Activating colorbox using Drupal Behaviours to make sure it is only loaded within its context.
*/
// JavaScript should be made compatible with libraries other than jQuery by
// wrapping it with an "anonymous closure". See:
// - https://drupal.org/node/1446420
// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
var frugalzontitle = jQuery('h1').text().trim();
var frugalzonprice = jQuery('.a-color-price, .priceLarge').eq(0).text().trim().replace("$","");
var frugalzoncategory = jQuery('.nav-category-button').eq(0).text().trim().replace('All ', '').replace(',', '');
var frugalzonimage = jQuery('#holderMainImage img, #prodImageCell img').attr('src');
var frugalzonurl = document.URL;
if (frugalzonurl.indexOf('?') > -1) {
frugalzonurl += '&tag=frugalzon-20';
} else {
frugalzonurl += '?tag=frugalzon-20';
}