Skip to content

Instantly share code, notes, and snippets.

View zomars's full-sized avatar
🙏
Never stop learning

Omar López zomars

🙏
Never stop learning
View GitHub Profile
var CKEDITORPluginExtras = false;
if (typeof(CKEDITOR) != 'undefined' ) {
CKEDITOR.on('instanceReady',function(event, instance){
if (CKEDITORPluginExtras) {
return;
}
var config = event.editor.config;
CKEDITOR.instances.body.destroy();
var scripts = ['app.a700a9a3e91a84de5dc0.js']; // script for all users
var newBrowser = (
'fetch' in window &&
'Promise' in window &&
'assign' in Object &&
'keys' in Object
);
if (!newBrowser) {
@stratosgear
stratosgear / paypal_experience.md
Last active July 29, 2019 15:26
Ask HN: Is this Paypal experience customary?

Here is a succinct timeline of the events.

  • I received a Paypal notification that 600 USD were deposited on my account.
  • I was not expecting any money, so I logged in to see what this is about.
  • Apparently someone paid me for an item they bought on Ebay.
  • The information contained on my Paypal account about the transaction, did NOT contain any information on what this is about.
  • I am NOT an Ebay seller, so I have nothing else to follow this up.
  • My first thought (apart from quickly spending the money) was that some poor soul after thinking that they have paid for an item they would wait for ever for an item they thought they purchased, only to never receive it.
  • So I spent some considerable amount of time trying to locate the seller from their name only (did not have an email) by googling around, to clarify the issue
  • As it was getting late, I left the issue to continue the next day.
@paulrobertlloyd
paulrobertlloyd / index.html
Created May 9, 2018 15:48
Andy Dennis’ function introduction
<html>
<body>
<a class="that" href="yippee.html">That link</a>
<script>
var foo = function () {
var $ = document.querySelector.bind(document)
var el = {
thatLink: $('a.that')
}
function addListeners () {
@jsoendermann
jsoendermann / sectionListGetItemLayout.jsx
Last active December 9, 2019 21:16
sectionListGetItemLayout
import sectionListGetItemLayout from 'react-native-section-list-get-item-layout'
class MyComponent extends React.Component {
constructor(props) {
super(props)
this.getItemLayout = sectionListGetItemLayout({
// The height of the row with rowData at the given sectionIndex and rowIndex
getItemHeight: (rowData, sectionIndex, rowIndex) => sectionIndex === 0 ? 100 : 50,
@Ema4rl
Ema4rl / ssbg-slideshow.js
Last active January 18, 2020 18:43 — forked from ki11ua/Super simple background image slideshow.css
Super Simple jQuery Background-image Slideshow (using CSS3 for the transition, gets the image paths via HTML5 `data` attribute, and with image preload trick).
/*!
* By Eharry.me (https://gist.github.com/Ema4rl/b8ef90be99205ddada5ef2cd6e632ebe)
*/
! function ($) {
"use strict";
var slide = $("[data-slides]"),
count = 0,
slides = slide.data("slides"),
len = slides.length,
n = function () {
@n1k0
n1k0 / 404checker.js
Created January 11, 2013 10:55
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@dsafreno
dsafreno / withDbData.js
Last active July 21, 2020 17:14
Helper to use Firebase RTDB with React more conveniently. From https://pragli.com/blog/how-we-use-firebase-instead-of-redux-with-react
import React from 'react';
import firebase from 'firebase/app';
import equal from 'deep-equal';
function filterKeys(raw, allowed) {
if (!raw) {
return raw;
}
let s = new Set(allowed);
return Object.keys(raw)
function* runTimer(getState) {
while(yield take('START')) {
while(true) {
const {stop, tick} = yield race({
stop : take('STOP'),
tick : call(wait, ONE_SECOND);
})
if ( !stop ) {
yield put(actions.tick());
import React from 'react';
const handleChange = (handler) => ({target: {files}}) =>
handler(files.length ? {file: files[0], name: files[0].name} : {});
export default ({
input: {onChange, onBlur, value: omitValue, ...inputProps},
meta: omitMeta,
...props
}) => (