Skip to content

Instantly share code, notes, and snippets.

@benknight
benknight / SassMeister-input.scss
Last active December 27, 2015 01:09
An index bookmarklet for all my gists that are Yelp UI tweaks.
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
#yelp-ui-demos {
z-index: 9999; // "I'M THE TOP-MOST THING I PROMISE!"
-webkit-font-smoothing: antialiased;
position: fixed;
bottom: 10px;
@benknight
benknight / gist:6987563
Last active December 25, 2015 13:59
Baz slideshow concept
(function() {
if ( ! $(document.body).is('.biz-details') ) {
return false;
}
var current_set = 0;
var num_sets;
var photos = [];
var photo_sets = [];
var timeout_id;
@benknight
benknight / gist:6619328
Last active December 23, 2015 10:09
Yelp CSS rewrites remove visual container, restyle header add ons bar
body {
background: white;
}
#super-container {
-webkit-box-shadow: none;
box-shadow: none;
border: none;
}
@benknight
benknight / gist:6591197
Last active December 23, 2015 05:59
New yelp.com loading spinner
.yelp-spinner {
opacity: 1;
background-color: rgba(255, 255, 255, 0.75);
}
.yelp-spinner .large-throbber-container {
background: url(http://f.cl.ly/items/1H1o3I3g3F3g343g190V/11_small.gif) no-repeat center;
background-color: white;
height: 92px;
width: 80px;
@benknight
benknight / gist:6575768
Last active December 23, 2015 03:49
Create a notepad in a browser tab bookmarklet.
Drag me to the bookmark bar:<br>
<a href="data:text/html, <body contenteditable style='font-family:Monaco,monospace;font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;'>">Notpad</a>
@benknight
benknight / gist:6558278
Last active December 23, 2015 01:09
Code for applying JavaScript and CSS code from a Gist to a page. (This is *so* meta.)
<h1>Apply Gist Bookmarklet</h1>
Drag me into the bookmarks bar:<br>
<a href="javascript:(function()%7Bvar%20gist_id%3Dprompt(%27What%E2%80%99s%20the%20Gist%20ID%3F%27)%3Bvar%20css%3D%5B%5D%3Bvar%20js%3D%5B%5D%3Bvar%20applyCSS%3Dfunction()%7Bfor(var%20x%20in%20css)%7Bvar%20style%3Ddocument.createElement(%27style%27)%3Bstyle.innerHTML%3Dcss%5Bx%5D%3Bdocument.head.appendChild(style)%3B%7D%7D%3Bvar%20applyJS%3Dfunction()%7Bfor(var%20x%20in%20js)%7Bvar%20script%3Ddocument.createElement(%27script%27)%3Bscript.innerHTML%3Djs%5Bx%5D%3Bdocument.body.appendChild(script)%3B%7D%7D%3Bvar%20xhr%3Dnew%20XMLHttpRequest()%3Bxhr.open(%27GET%27,%27https://api.github.com/gists/%27%2Bgist_id,true)%3Bxhr.onload%3Dfunction()%7Bvar%20data%3DJSON.parse(this.responseText)%3Bfor(var%20file%20in%20data.files)%7Bif(data.files%5Bfile%5D.language%3D%3D%27CSS%27)%7Bcss.push(data.files%5Bfile%5D.content)%3B%7Dif(data.files%5Bfile%5D.language%3D%3D%27JavaScript%27)%7Bjs.push(data.files%5Bfile%5D.content)%3B%7D%7DapplyCSS()%3BapplyJS()%3B%7D
@benknight
benknight / gist:6503634
Last active December 22, 2015 17:08
Scss @extend puzzle
// In:
// ---
li ul li a {
color: white;
}
li li li b {
@extend a;
}
@benknight
benknight / dabblet.css
Created May 7, 2013 20:58
When mouseup and mousedown occur on different target elements, nothing happens. Therefore, it's probably a bad idea to "depress" buttons down 1px on click. Doesn't matter if you use CSS transform or position.
/**
* When mouseup and mousedown occur on different target elements, nothing happens.
*/
a { display: block; }
a:active {
transform: translateY(100px);
}
@benknight
benknight / dabblet.css
Created April 9, 2013 19:06
Old flexbox will stretch to contain floats, while new flexbox won't (proper behavior).
/**
* Old flexbox will stretch to contain floats, while new flexbox won't (proper behavior).
*/
.flex-container {
display: -webkit-flex;
background: paleGreen;
}
.flex-container.old {
@benknight
benknight / gist:5135874
Last active December 14, 2015 19:19
Append Grapper to the bottom half of the window
var grapper = document.createElement('iframe');
grapper.id = 'grapper';
grapper.src = 'http://dev16.706.yelpcorp.com:4773/';
document.body.appendChild(grapper);