Skip to content

Instantly share code, notes, and snippets.

View insin's full-sized avatar
⚠️
Cannot read property 'status' of undefined

Jonny Buchanan insin

⚠️
Cannot read property 'status' of undefined
View GitHub Profile
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
@insin
insin / console.js
Created August 2, 2023 16:50
Get currently-loaded user entities on twitter.com
entities = $('#react-root')._reactRootContainer._internalRoot?.current?.memoizedState?.element?.props?.children?.props?.store?.getState()?.entities?.users?.entities
users = {}
for (let user of Object.values(entities)) {
users[user.screen_name] = user
}
@insin
insin / userstyle-for-new-tweetdeck.css
Last active July 4, 2023 08:45
Userstyle for New TweetDeck - use with the Stylus extension: https://github.com/openstyles/stylus#stylus
/* Hide... */
/* Views on list tweets */
[data-testid="tweet"][tabindex="0"] div[id^=id__][role=group] > div:nth-child(4):nth-last-child(2),
/* Views on focused tweet */
[data-testid="tweet"][tabindex="-1"] div[dir] + div[aria-hidden="true"]:nth-child(2):nth-last-child(2),
[data-testid="tweet"][tabindex="-1"] div[dir] + div[aria-hidden="true"]:nth-child(2):nth-last-child(2) + div[dir]:last-child,
/* Bookmark button on focused tweet */
[data-testid="tweet"][tabindex="-1"] div[id^=id__][role=group] > div:nth-child(4):nth-last-child(2),
/* Share button on all tweets */
div[id^=id__][role=group] > div:nth-child(5):last-child,
@insin
insin / app.jsx
Last active May 30, 2023 20:02
react-calendarbits: Simple components for rendering calendars for prototyping date-based stuff (Live version: http://bl.ocks.org/insin/raw/56a10daa808cdcdcbf83/)
void function() { 'use strict';
var cx = (staticClasses, conditionalClasses) => {
var classNames = []
if (typeof conditionalClasses == 'undefined') {
conditionalClasses = staticClasses
}
else {
classNames.push(staticClasses)
}
var CommentList = React.createClass({
render() {
return <div className="commentList">
{this.props.data.map(comment => <Comment author={comment.author}>
{comment.text}
</Comment>)}
</div>
}
})
@insin
insin / index.js
Created June 15, 2015 11:50
Get the 1-based index of an Excel cell given its column name
var baseCharCode = 'A'.charCodeAt(0) - 1 // Index is 1-based in Excel Interop
function excelColIndex(colName) {
var index = 0
for (var i = 0, pow = colName.length - 1; i < colName.length; i++, pow--) {
index += Math.pow(26, pow) * (colName.charCodeAt(i) - baseCharCode)
}
return index
}
@insin
insin / index.js
Created June 19, 2015 12:52
Hide Github comments from people who aren't owners/collaborators
[].forEach.call(document.querySelectorAll('.timeline-comment-wrapper'), comment => {
if (!comment.querySelector('.timeline-comment-label')) {
comment.style.display = 'none'
}
})
@insin
insin / IDEAS.md
Last active May 30, 2023 19:55
IDEAS.md (coming soon - open in http://insin.github.io/ideas-md#98eed17905bcb6a65bf0 for editing)

Hello from Gist!

Hello from IDEAS.md

ideas-md

Markdown ↔ HTML view

Confirmation for certain actions

require('array.prototype.fill')
var React = require('react')
var EmailList = require('./EmailList')
var App = React.createClass({
render() {
return <div className="App">
<EmailList quantity={5}/>
</div>
@insin
insin / ReduxMicroBoilerplate.js
Last active May 30, 2023 19:54 — forked from gaearon/ReduxMicroBoilerplate.js
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------