Skip to content

Instantly share code, notes, and snippets.

View orrybaram's full-sized avatar
🍕
pizza time!

Orry Baram orrybaram

🍕
pizza time!
View GitHub Profile
@orrybaram
orrybaram / componentSyntaxError.jsx
Last active August 10, 2018 21:01
Naming Styled Components
View componentSyntaxError.jsx
const Navigation = styled.div`/* styles */`;
const Navigation = () => (
<Navigation />
);
// => JS interpreter: "I can't believe you've done this x_x"
@orrybaram
orrybaram / README.md
Created January 12, 2018 15:55
RaiblocksJs boilerplate
View README.md
View cssObjToCssString.js
const numberToPixel = prop => {
if (!Number.isInteger(prop) || prop === 0) return prop;
return `${prop}px`;
}
const camelToDash = str => str
.replace(/(^[A-Z])/, ([first]) => first.toLowerCase())
.replace(/([A-Z])/g, ([letter]) => `-${letter.toLowerCase()}`)
View vscode-scrolling-issue.html
<!doctype html>
<html ⚡ lang="en">
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<title>Amp Ads | Mic</title>
<link rel="canonical" href="http://example.ampproject.org/article-metadata.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="amp-3p-iframe-src" content="https://localhost:9666/amp-remote">
<script type="application/ld+json">
View dirtydaub.zsh-theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# DirtyDaub's Theme - https://gist.github.com/orrybaram/8ce1eeefda56d72437153d98295f88a2
# An Agnoster / Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@orrybaram
orrybaram / hoverIntent.js
Last active December 27, 2015 04:41
Hover delay for mousing on and off and element.
View hoverIntent.js
/**
* Adds a delay to a hovered element
* @param {DOMElement} el
* @param {Object} opts
* opts = {
onHover: {Function},
offHover: {Function},
onDelay: {Integer},
offDelay: {Integer},
hoverTarget: {DOMElement}
@orrybaram
orrybaram / listenWithMe.js
Last active July 31, 2016 20:54
Add an embedded spotify player that plays the track your currently listening to (or last listened to) Demo at http://orryb.com/projects/currentSpotify/
View listenWithMe.js
var ListenWithMe = (function() {
// Add your own config here
var LASTFM_API_KEY = "";
var LASTFM_USERNAME = "";
// Element to inject the widget into
var $playerWrapper = document.getElementById('spotify-player-wrapper');
return {
init: init
}
@orrybaram
orrybaram / Kurz Gesagt inspired Animated Earth.markdown
Last active March 3, 2018 16:42
Kurz Gesagt inspired Animated Earth
@orrybaram
orrybaram / thebutton.js
Last active August 29, 2015 14:18
The button clicker and logger
View thebutton.js
var ButtonHaxor = (function() {
// Set to what you want the button to be clicked on
var CLICK_ON_SCORE = 1;
var interval = null;
var low_score = 60;
var clicked_score = 60;
var times_clicked = 0;