Skip to content

Instantly share code, notes, and snippets.

@itrelease
itrelease / delayed.js
Last active August 29, 2015 14:25
Delayed redux action
export default function delay({ dispatch, getState }) {
const delayed = {};
return (next) => {
return (action) => {
const actionIndex = (delayed[action.type] || []).indexOf(action.delay);
if (delayed[action.type] && actionIndex > -1) {
const delayedActionCreator = delayed[action.type][actionIndex];
@import '~constants';
.stamp-Video {
position: relative;
background-color: @blackColor;
cursor: pointer;
}
.stamp-Video-box {
color: @lightColor;
@itrelease
itrelease / pn.js
Created February 20, 2016 14:51
pn.js
/* eslint-disable no-console */
import React, { PropTypes, Component } from 'react';
import getClassName from '../../utils/getClassName';
const bem = getClassName('TriggerPushNotification');
export default class TriggerPushNotification extends Component {
static get propTypes() {
return {
import React, { Component, PropTypes } from 'react';
import { Footer, Header } from 'components/index';
import styles from './FAQPage.scss';
function highlightWord(root, word) {
/* eslint-disable no-shadow, no-cond-assign */
function textNodesUnder(root) {
const walk = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false);
const bigBird = {
name: 'Big Bird',
address: { name: 'Whatever' },
age:6,
comments:[
{body:'sing, sing a song',title:'Line 1'},
{body:'make it simple',title:'Line 2'},
{body:'sing out strong',title:'Line 3'}]
};
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script>this.Meduza = function(modules) {
function __webpack_require__(moduleId) {
if (installedModules[moduleId]) return installedModules[moduleId].exports;
var module = installedModules[moduleId] = {
exports: {},
@itrelease
itrelease / Buffer Overflow Tutorial in Kali.md
Created March 29, 2017 23:11 — forked from apolloclark/Buffer Overflow Tutorial in Kali.md
Buffer overflow demonstration in Kali Linux, based on the Computerphile video
class SomeComponent extends React.Component {
...
componentDidMount() {
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "[path_to_some_library]";
document.getElementsByTagName("head")[0].appendChild(script);
}
...
const App = () => {
return (
<ul>
<li><blockquote class="twitter-video" data-lang="en"><p lang="en" dir="ltr">One of the most incredible videos I’ve ever seen! <a href="https://twitter.com/hashtag/Sinabung?src=hash&amp;ref_src=twsrc%5Etfw">#Sinabung</a> <a href="https://twitter.com/hashtag/Sumatra?src=hash&amp;ref_src=twsrc%5Etfw">#Sumatra</a> <a href="https://twitter.com/hashtag/Indonesia?src=hash&amp;ref_src=twsrc%5Etfw">#Indonesia</a> <a href="https://t.co/TsLymrIRJw">pic.twitter.com/TsLymrIRJw</a></p>— UK Weather Live (@UKWeatherLive) <a href="https://twitter.com/UKWeatherLive/status/965485425187082240?ref_src=twsrc%5Etfw">February 19, 2018</a></blockquote><script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></li>
<li><blockquote class="twitter-video" data-lang="en"><p lang="en" dir="ltr">Huge errupted of Mount Sinabung. <a href="https://t.co/Ood1dGKfS2">pic.twitter.com/Ood1dGKfS2</a></p>— ..e.. (@edykbarus) <a href="https://twitter.com/edykbarus/status
class App extends React.Component {
element = null;
componentDidMount() {
const scriptElements = this.element.querySelectorAll('script');
scriptElements.forEach(sEl => {
const scriptEl = document.createElement('script');
const attrs = sEl.attributes;