Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Sherbondy tonysherbondy

  • San Francisco, CA
View GitHub Profile
@tonysherbondy
tonysherbondy / example_observer.cljs
Created Jun 27, 2018
Show motivating example for reg-obs
View example_observer.cljs
(db-utils/reg-obs
::obs-for-new-smart-boost
[[::routes/route]
[::working-boost]]
(fn [route working-boost]
(cond
(and (= (:handler route) :manage/content-two-new-smart-boost)
(not working-boost))
(rf/dispatch [::set-working-boost {:smart-boost-id (random-uuid)
:name "My SmartBoost"
View .ideavimrc
" ---------------
" Searching
" ---------------
set ignorecase " Case insensitive search
set smartcase " Non-case sensitive search
set incsearch " Incremental search
set hlsearch " Highlight search results
" ---------------
" Extensions
View snippets_for_lab.js
// 2.2
import { AppRegistry } from 'react-native'
import App from './App.react'
AppRegistry.registerComponent('YOUR_PROJECT_NAME', () => App)
// 4.2
propTypes = {
post: PropTypes.shape({
imageURL: PropTypes.string.isRequired,
caption: PropTypes.string.isRequired,
View convertHtmlToPlainText.js
const convertHtmlToPlainText = html => {
const dict = {
gt: '>',
hellip: '...',
ldquo: '"',
rdquo: '"',
lsquo: "'",
rsquo: "'",
ndash: '-',
}
View california_propositions.json
{
"propositions": [
{
"name": "",
"imageUrl": "https://ballot.fyi/static/img/index/schoolbus.png",
"subTitle": "Fiscally, the biggest measure on the ballot. $9B + $8B interest.",
"url": "https://ballot.fyi/51",
"propCode": "51",
"color": "rgb(238, 138, 50)",
"title": "Prop 51 makes $9B to build and improve schools"
@tonysherbondy
tonysherbondy / SearchBarFinish.js
Created Jul 24, 2016
Final implementation of simple Search Bar for React Native
View SearchBarFinish.js
import React from 'react'
import {
View,
ListView,
Text,
StyleSheet,
TextInput,
} from 'react-native'
import names from './names'
@tonysherbondy
tonysherbondy / SearchBarStart.js
Last active Jul 24, 2016
Start of implementing Search Bar in React Native Guide
View SearchBarStart.js
import React from 'react'
import {
View,
ListView,
Text,
StyleSheet,
} from 'react-native'
import names from './names'
const styles = StyleSheet.create({
View _.md
@tonysherbondy
tonysherbondy / prototypeCellWoes.m
Created Mar 21, 2014
How I'm instantiating my prototype cell and causing an infinite loop
View prototypeCellWoes.m
-(ResultTableViewCell *)prototypeResultCell
{
// lazily instantiate and hold onto the prototype
if (!_prototypeResultCell) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
_prototypeResultCell = [self.tableView dequeueReusableCellWithIdentifier:@"ResultTableViewCell" forIndexPath:indexPath];
}
return _prototypeResultCell;
}