Skip to content

Instantly share code, notes, and snippets.

View johnmarinelli's full-sized avatar

John Marinelli johnmarinelli

View GitHub Profile
@johnmarinelli
johnmarinelli / saga.js
Last active September 5, 2018 18:14
redux-saga call() not working?
import { put, call, takeEvery } from 'redux-saga/effects'
import * as Actions from '@actions/Artsy'
export function* fetchData(client, artworkId) {
yield call(Actions.artsyFetchStart)
try {
const artwork = yield call(client.getData, { id: artworkId }) // this returns undefined
yield call(Actions.artsyFetchSuccess)
@johnmarinelli
johnmarinelli / .babelrc
Last active June 27, 2018 15:43
da fuck?
{
"presets": ["react-native"],
"plugins": [
[
"module-resolver",
{
"alias": {
"@assets": "./assets",
"@src": "./src",
"@components": "./src/components",
@johnmarinelli
johnmarinelli / app.js
Last active August 17, 2021 19:25
Cavy + React Navigation (TabNavigator)
import { TabNavigator } from 'react-navigation'
import Ionicons from 'react-native-vector-icons/Ionicons'
import { hook } from 'cavy'
class Icon extends Component {
render() {
const { navigation, generateTestHook, routeName... } = this.props
return <Ionicons ref={generateTestHook(`Navigation.${routeName}`)} onPress={() => navigation.navigate(routeName)} .../>
}
}
@johnmarinelli
johnmarinelli / App.js
Created April 28, 2018 15:42
redux persist config
const persistConfig = {
key: 'root',
storage,
whitelist: ['user', 'BrowseScreen', 'wikiArt'],
}
const persistedReducer = persistReducer(persistConfig, AppReducer)
this.store = Reactotron.createStore(
@johnmarinelli
johnmarinelli / index.ts
Last active March 10, 2018 10:17
ts => js
import axios from 'axios'
export default class WikiArtClient {
...
}
@johnmarinelli
johnmarinelli / fish_prompt.fish
Created January 25, 2018 21:25
place this in $OMF_PATH/themes/bira/
# Theme based on Bira theme from oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme
# Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/
# I replaced the ruby version with node version. - John
function __user_host
set -l content
if [ (id -u) = "0" ];
echo -n (set_color --bold red)
else
// seen at https://conference.awwwards.com/berlin
var f = ["background: linear-gradient(135deg, rgba(248, 97, 97, 1) 0%,rgba(105, 81, 255, 1) 100%);", "color: white", "padding: 10px 20px", "line-height: 35px"].join(";");
console.log("%cAwwwards Conf 2018 | coded by Andrea Gottardi @ Adoratorio", f)
#include <iostream>
#include <vector>
class Subject;
class Observer
{
public:
Observer();
virtual void update(int subjVal) = 0;
/*
referring to this link: https://www.khronos.org/opengl/wiki/Vertex_Specification_Best_Practices
"Formatting VBO data":
does the following:
*/
GLuint v, n, c;
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
GLfloat cube_vertices[] = {
// front