Skip to content

Instantly share code, notes, and snippets.

View caseyyee's full-sized avatar
👀
Now in (( Stereo ))

Casey Yee caseyyee

👀
Now in (( Stereo ))
View GitHub Profile
@Kikobeats
Kikobeats / Hide.js
Last active February 26, 2020 17:34
Hide + rebass
import styled from 'styled-components'
import { theme } from 'rebass'
const { breakpoints } = theme
const lastIndex = breakpoints.length - 1
const getMediaBreakpoint = (breakpoints, breakpoint, index) => {
if (index === 0) return `@media screen and (max-width: ${breakpoint})`
const prevBreakpoint = breakpoints[index - 1]
if (index === lastIndex) {
@mattdesl
mattdesl / modular-three.md
Last active December 9, 2021 03:20
quick/easy ThreeJS hacking with npm

This isn't bullet-proof but here's how I've doing things lately:

modular ThreeJS quickie

  • npm install three --save
  • Include this in your browserify/webpack root script, typically your index.js:
global.THREE = require('three')
  • Add the "THREE" global to your linter (e.g. semistandard/eslintrc)
@Restuta
Restuta / HOC.js
Last active May 26, 2024 20:01
React HOC (Higher Order Component) Example
/* HOC fundamentally is just a function that accepts a Component and returns a Component:
(component) => {return componentOnSteroids; } or just component => componentOnSteroids;
Let's assume we want to wrap our components in another component that is used for debugging purposes,
it just wraps them in a DIV with "debug class on it".
Below ComponentToDebug is a React component.
*/
//HOC using Class
//it's a function that accepts ComponentToDebug and implicitly returns a Class
let DebugComponent = ComponentToDebug => class extends Component {
@rxaviers
rxaviers / gist:7360908
Last active June 29, 2024 18:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@cwey
cwey / quantize.js
Last active March 22, 2019 01:45 — forked from nrabinowitz/quantize.js
Fixed the two issues reported by leeoniya and by iOSBrett * green is being used again here instead of blue. (line 233) * incorrectly used rval 3 times (line 189)
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: