Skip to content

Instantly share code, notes, and snippets.

View bryanberger's full-sized avatar
👨‍💻
always makin'

Bryan Berger bryanberger

👨‍💻
always makin'
View GitHub Profile
@bryanberger
bryanberger / SimpleCircularBuffer.js
Last active December 13, 2015 22:08
Simple Javascript Circular Buffer
/** one way of doing it **/
var CircularBuffer = exports.CircularBuffer = function(size) {
this.pos = 0
this._buf = []
this.size = size
}
CircularBuffer.prototype.get = function(i) {
if (i == undefined) i = 0;
if (i >= this.size) return undefined;
@bryanberger
bryanberger / simplemoduleexport.js
Last active December 13, 2015 22:09
Simple Module Export - Supports require.js defining of jQuery into the module.
//
// more documentation on the module pattern here: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
//
(function( factory ) {
// if require js is available use it to define jquery and require it.
if (typeof define !== 'undefined' && define.amd) {
define(['jquery'], factory);
} else if (typeof module !== 'undefined' && module.exports) {
var jQuery = require('jquery');
module.exports = factory( $ );
(function() {
// I would love to use matchmedia but its not supported by IE9, instead lets check the viewport width onresize
var $lightbox_form_container = $('.new_user_lightbox_form_container');
// run onload
updateModal();
// run onresize
$(window).resize(updateModal);
@bryanberger
bryanberger / git_bible.md
Last active June 14, 2016 15:19 — forked from dmglab/git_bible.md
how to git

Note: this is a summary of different git workflows putting together to a small git bible. references are in between the text


How to Branch

try to keep your hacking out of the master and create feature branches. the [feature-branch workflow][4] is a good median between noobs (i have no idea how to branch) and git veterans (let's do some rocket sience with git branches!). everybody get the idea!

Basic usage examples

config = {
enabled: true,
items: [
{
inclusions: '',
message: 'Check out our awesome More than School campaign: click here',
url: '/more-than-school',
newtab: true,
label: 'mts',
style: 'mts',

Sketch Shared Libraries in Abstract


Agenda

  • What is a Shared Library?
  • How do you use symbols from a Shared Library?
  • How do you edit/update symbols from a Shared Library?
  • How do you link a Shared Library on Abstract to your project file?
import * as React from "react"
import {
addPropertyControls,
ControlType,
BooleanControlDescription,
EnumControlDescription
} from "framer"
import * as Cog from '../../../dist/framer/'
import { BoxProps, BoxTheme } from '../../../dist/Box'
@bryanberger
bryanberger / Example.js
Created December 4, 2019 23:39
Formik + Yup
import React from 'react';
import { Formik, Field, Form, ErrorMessage } from 'formik';
import * as Yup from 'yup';
const SignupForm = () => {
return (
<Formik
initialValues={{ firstName: '', lastName: '', email: '' }}
validationSchema={Yup.object({
firstName: Yup.string()