Skip to content

Instantly share code, notes, and snippets.

View balibou's full-sized avatar

Benjamin Cherion balibou

View GitHub Profile
@balibou
balibou / posthotfix.sh
Created January 1, 2018 12:16
posthotfix.sh
#!/bin/bash
# this script will merge the hotfix branch
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
@balibou
balibou / prehotfix.sh
Last active January 1, 2018 12:15
prehotfix.sh
#!/bin/bash
# this script will create a hotfix branch
# get package.json version
prop="version"
PACKAGE_VERSION="$(node -pe "require('./package.json')['$prop']")"
# define package version
PACKAGE_VERSION_LIST=(`echo $PACKAGE_VERSION | tr '.' ' '`)
0xD19D2b80d8F424aee91263c357938806A7d9B22a
@balibou
balibou / Dashboard.vue
Created March 13, 2017 12:32
TypeError: child._updateFromParent is not a function
<template lang="html">
<div>
<top-stats v-on:dataChanged="UpdateChart"></top-stats>
<line-chart></line-chart>
</div>
</template>
<script>
import { SET_CHART } from '../../vuex/mutation-types.js'
import LineChart from '../charts/LineChart.vue'
// ./imports/ui/components/public-navigation.js
import React from 'react';
import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap';
import { Nav, NavItem } from 'react-bootstrap';
export const PublicNavigation = () => (
<div>
{/*Add a 'Plans' link*/}
<Nav>
// ./imports/startup/client/routes.js
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { Meteor } from 'meteor/meteor';
import { App } from '../../ui/layouts/app';
import { Documents } from '../../ui/pages/documents';
import { Index } from '../../ui/pages/index';
import { Login } from '../../ui/pages/login';
// ./imports/api/stripe/methods.js
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
// Connect to the Stripe API with the private token
// No need to declare StripeAPI, it is provided with mrgalaxy:stripe package
// (https://github.com/tyler-johnson/stripe-meteor/blob/master/stripe_server.js)
const stripe = StripeAPI(Meteor.settings.private.stripe);
@balibou
balibou / api.js
Last active August 3, 2016 10:07
// ./imports/startup/server/api.js
import '../../api/documents/methods.js';
import '../../api/documents/server/publications.js';
//Add this path for getting stripe methods
import '../../api/stripe/methods';
// ./imports/startup/server/browser-policy.js
import { BrowserPolicy } from 'meteor/browser-policy-common';
BrowserPolicy.content.allowOriginForAll('https://js.stripe.com/');
BrowserPolicy.content.allowOriginForAll('https://checkout.stripe.com/');
BrowserPolicy.content.allowOriginForAll('https://tmc-post-content.s3.amazonaws.com/');
BrowserPolicy.content.allowOriginForAll('https://q.stripe.com/');
// ./imports/ui/components/plan.jsx
import React from 'react';
import { ListGroupItem } from 'react-bootstrap';
export const Plan = React.createClass({
propTypes: {
plan: React.PropTypes.object.isRequired,
selectedPlan: React.PropTypes.func,