Skip to content

Instantly share code, notes, and snippets.

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

Praveen apnerve

🏠
Working from home
View GitHub Profile
@threepointone
threepointone / store.js
Created July 21, 2014 06:00
simple stores for flux
var util = require('util'),
_ = require('underscore'),
EventEmitter = require('events').EventEmitter
function Store(ctx, initial) {
this.state = initial || {};
EventEmitter.call(this);
this.initialize.apply(this, arguments);
}
@dezinezync
dezinezync / flexit.less
Last active May 17, 2016 07:21
Stupid simple flexbox for less.js
.flexIt(@type:flex) {
display: ~"-webkit-@{type}";
display: @type;
}
.flexDirection(@direction:row) {

This is a working document

The Feature

Definition of this document

To outline what a feature is, how a feature grows from Idea, Conception, Birth and through to Adulthood (Iteration).

What is a feature?

@pacreate
Feature: PA Create Latest Images Page - Latest Images Page
Scenario: Verify Latest Images page has infinite scroll
Given I navigate to the images tab at url "/create/images"
And the images view displays 30 images
And I scroll down
And the images view displays 44 images
Scenario: Verify images are displayed correctly
@hamrammi
hamrammi / whatsapp-send-in-current-chat.js
Last active March 22, 2020 13:47 — forked from EyMaddis/whatsapp-send-in-current-chat.js
Sending messages programmatically on web.whatsapp.com
// this allows to send arbitrary messages. The chat conversation you want to send messages to has to be open.
// just run this in the JS console
// http://stackoverflow.com/a/39165137/1249001
function findChatComponent(dom) {
var result = null
for (var key in dom) {
if (key.startsWith("__reactInternalInstance$")) {
try {
result = dom[key].child.child.memoizedProps.children._owner.stateNode.props.chat
@insin
insin / app.jsx
Last active July 13, 2021 07:39
React Form Handling - handleFormInputChange (Live version: http://bl.ocks.org/insin/raw/082c0d88f6290a0ea4c7/)
var INPUT_TYPES = 'color|date|datetime|datetime-local|file|month|number|password|range|search|tel|text|time|url|week'.split('|')
var App = React.createClass({
getInitialState: function() {
return {}
},
onChange: handleFormInputChange,
render: function() {

Hi Zach :D

Modals are funny beasts, usually they are a design cop-out, but that's okay, designers have to make trade-offs too, give 'em a break.

First things first, I'm not sure there is such thing as a "simple" modal that is production ready. Certainly there have been times in my career I tossed out other people's "overly complex solutions" because I simply didn't understand the scope of the problem, and I have always loved it when people who have a branch of experience that I don't take the time

@Rich-Harris
Rich-Harris / README.md
Last active March 31, 2023 13:46
Testing array.splice vs array.pop vs set.delete

You have an array. Its sort order doesn't matter. You want to remove an item from this array.

The obvious thing to do would be to use splice:

function remove(array, item) {
  const index = array.indexOf(item);
  array.splice(index, 1);
}
@benjamingr
benjamingr / gist:0237932cee84712951a2
Last active October 6, 2023 08:31
Promise unhandled rejection tracking global handler hook

Possibly Unhandled Rejection NodeJS Promise Hook

###Unhandled Rejection Tracking

Several promise libraries such as bluebird and when as well as some native promise implementations offer potentially unhandled rejection tracking. This means that the following:

Promise.reject(new Error("err")); // never attach a `catch`
@nicoleslaw
nicoleslaw / 1_Tiny_Content_Framework.md
Last active January 23, 2024 02:28
Tiny Content Framework

Tiny Content Framework

About the project

This is a tiny content strategy framework focused on goals, messages, and branding. This is not a checklist. Use what you need and scrap the rest. Rewrite it or add to it. These topics should help you get to the bottom of things with clients and other people you work with.

Give me feedback on Twitter (@nicoleslaw) or by email (nicole@nicolefenton.com).

Contents