Skip to content

Instantly share code, notes, and snippets.

@steve-ross
steve-ross / .eslintrc
Created January 17, 2018 20:14
eslint meteor react
{
"env": {
"es6": true,
"node": true,
"jquery": true
},
"parser": "babel-eslint",
"extends": [
@steve-ross
steve-ross / users.js
Created December 21, 2017 19:12
Simple Schema Example for a user
import { Validator } from '../../imports/schemas/validators';
Schemas.UserProfile = new SimpleSchema({
name : {
type : String,
autoform: {
label: 'Full Name'
},
custom: Validator.twoOrMoreWords
},
{
"blocks": [{
"name": "Collection callout",
"class": "index-section",
"settings": [{
"type": "collection",
"id": "collection",
"label": "Collection"
},
{
@steve-ross
steve-ross / 26_remove_profile_email.js
Created December 20, 2017 14:14
migration with temporary simple schema
Migrations.add({
version : 26,
name : 'Remove profile.email from users',
up : function(){
// add optional profile.email so we can remove it
var profile = _.extend({
email : {
type : String,
optional: true
}
@steve-ross
steve-ross / methods.js
Created December 6, 2017 20:10
Validated alert method for meteor
// location: imports/api/util/server/methods.js
import { Meteor } from 'meteor/meteor';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
const env = process.env.NODE_ENV;
const environmentInfo = env === 'development' ? `[${process.env.HOME}]` : `${Meteor.settings['galaxy.meteor.com'].env.ROOT_URL}`;
const alert = new ValidatedMethod({
@steve-ross
steve-ross / .direnvrc
Last active November 14, 2017 19:28
Some Useful direnv.net helpers
install_nvm(){
log_status "Installing NVM"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
nvm install
}
npm_install(){
local HAS_NODE_MODULES_BIN=$(find node_modules/.bin)
if [ -z "$HAS_NODE_MODULES_BIN" ]; then
{
"blocks": [
{
"type": "hero",
"name": "Hero Banner",
"settings": [
{
"id": "bannerImage",
"type": "image_picker",
"label": "Banner Image"
@steve-ross
steve-ross / hub-browse-issue.fish
Last active March 9, 2017 18:12
Fish plugin to open the issue number for your git branch on github (if your branch is named) my-feature-branch#123 where #123 is your ticket number
function _git_branch_issue_number
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's/.*#//')
end
function hub-browse-issue
set -l issue_number (_git_branch_issue_number)
hub browse -- issues/$issue_number
end
@steve-ross
steve-ross / javascript.json
Created February 22, 2017 21:03
meteor snippets for vscode
{
"Meteor onCreated Method": {
"prefix": "mon",
"body": [
"Template.${1:name}.onCreated(function ${1:name}OnCreated() {",
"\tconst instance = this;",
"\t$0",
"\tinstance.autorun(() => {",
"\t});",
@steve-ross
steve-ross / showFiles.fish
Created August 3, 2016 18:18
Mac finder showhidden files fish function
function showFiles
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder /System/Library/CoreServices/Finder.app $argv
end