Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Baby Yoda is my spirit animal

Berkeley Martinez BerkeleyTrue

💭
Baby Yoda is my spirit animal
View GitHub Profile
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@BerkeleyTrue
BerkeleyTrue / LoopbackSync.md
Last active May 23, 2018
Loopback Replication/Synchronization
View LoopbackSync.md

Loopback Sync

Sync in Loopback requires Loopback in the client as well the server.

Loopback attaches a replicate method to each Model Class. Lets say I define a model called 'RemoteMat' in my loopback server. In my client loopback app, I define a local varient of this model called 'LocalMat'.

My app would use Browserify to package Loopback for the client.

On first app load, I would call a Bi-direction replication (or syncronization) method. This is currently not implament in Loopback but it is easy to create. I will go into more detials later.

View folder-structure.md

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@BerkeleyTrue
BerkeleyTrue / Thundercats and es5.md
Last active Aug 29, 2015
Thundercats es5 class creation
View Thundercats and es5.md

Thundercats and es5

@BerkeleyTrue
BerkeleyTrue / A-ProfetchRX-README.MD
Last active Aug 29, 2015
Reactive Fetcher anyone?
View A-ProfetchRX-README.MD

ProFetchRx

A Universal(read: isomorphic) JavaScript library for fetching data from remote datasources.

This describes what the api would look like for a fetcher based on RxJs.

View gist:da9e1e345c03b75d4b98
All times EST. Add your initials next to any slot you can take (preferably 2 - 4 hour consecutive slots), and in a few words what you plan to stream.
NOTE(berkeley) fork to edit just like a repo. Then ask Quincy to merge in changes
Thursday:
17:00 -
18:00 -
19:00 -
20:00 -
21:00 -
@BerkeleyTrue
BerkeleyTrue / rebase-merge.sh
Created Oct 9, 2015 — forked from jeffbcross/rebase-merge.sh
How angular merges PRs
View rebase-merge.sh
#See fetch_pr script https://gist.github.com/vojtajina/5538170
# fetch and checkout PR branch from "upstream" remote
fetch_pr 123
git fetch upstream
# Replay changes on top of master
git rebase upstream/master
# Replace upstream/master with this branch
git push upstream pr-123:master
@BerkeleyTrue
BerkeleyTrue / fetch-git-pr.bash
Created Oct 9, 2015 — forked from vojtajina/fetch-git-pr.bash
Bash script for fetching a pull request from github...
View fetch-git-pr.bash
# fetching a single pull request from github
# put it into ~/.profile or ~/.bashrc
function fetch_pr() {
PR=$1
BRANCH=$2
if [ -z $PR ]; then
echo "Missing pull request number"
return 1
fi
View give-brownies.js
/* eslint-disable no-process-exit */
require('dotenv').load();
var secrets = require('./config/secrets'),
mongodb = require('mongodb'),
Rx = require('rx'),
Observable = Rx.Observable,
MongoClient = mongodb.MongoClient;
const points = [
{username: 'abhisekp', points: 200 },
@BerkeleyTrue
BerkeleyTrue / ipMap.sh
Last active Jul 20, 2017
Redirect a url to a localhost port
View ipMap.sh
# First we need to map our localhost + port combo to another ip. You'll need root priviliges for this
sudo ifconfig lo0 10.0.0.1 alias && \
echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.1 port 80 -> 127.0.0.1 port 3000" | sudo pfctl -ef -
# Now edit /etc/hosts
sudo vim /etc/hosts
# and add the following to the list
# NOTE: Do not edit anthing on this list you did not add
10.0.0.1 mydomain.dev
10.0.0.1 www.mydomain.dev
# I choose to use a .dev TLD as these are never going to conflict seeing how google has bought these TLD's
You can’t perform that action at this time.