Skip to content

Instantly share code, notes, and snippets.

View round's full-sized avatar
🎯
Focusing

Maxim Leyzerovich round

🎯
Focusing
View GitHub Profile
@round
round / dabblet.css
Created September 13, 2012 16:50
Fixed ↔ Fluid Width Transitions
/* Fixed ↔ Fluid Width Transitions */
#outer {
display: block;
background: #fff;
width: 0;
overflow: visible;
padding: 1em;
margin: 0 auto; /*center on page*/
-webkit-transition: width 1s linear;
}
@round
round / dabblet.css
Created September 13, 2012 18:12
Pure CSS Semantic Horizontal Content Slider
/* Pure CSS Semantic Horizontal Content Slider */
body {
display: block;
position: fixed;
top: 0;
left: -400%;
width: 500%;
text-align: right;
padding: 0;
@round
round / overscroll.js
Last active August 29, 2015 14:05
Prevent Overscrolling on iOS
//uses document because document will be topmost level in bubbling
$(document).on('touchmove',function(e){
e.preventDefault();
});
//uses body because jquery on events are called off of the element they are
//added to, so bubbling would not work if we used document instead.
$('body').on('touchstart','.scrollable',function(e) {
if (e.currentTarget.scrollTop === 0) {
e.currentTarget.scrollTop = 1;
} else if (e.currentTarget.scrollHeight === e.currentTarget.scrollTop + e.currentTarget.offsetHeight) {
@round
round / gist:a7e8f83f53d12a352fbd
Last active August 29, 2015 14:07
S3 Public Bucket Policy
{
"Version":"2008-10-17",
"Statement":[{
"Sid":"AllowPublicRead",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::bucket/*"
@round
round / gist:c6d2db6a968b40304d7c
Created October 3, 2014 02:11
S3 Cors Configuration
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>
@round
round / script
Created February 7, 2015 05:33
Async Script Loader with Callback
var Loader = function () { }
Loader.prototype = {
require: function (scripts, callback) {
this.loadCount = 0;
this.totalRequired = scripts.length;
this.callback = callback;
for (var i = 0; i < scripts.length; i++) {
this.writeScript(scripts[i]);
}
@round
round / 0 Select Text
Last active August 29, 2015 14:15
Text Selection Snippets
function SelectText(element) {
var text = document.getElementById(element);
if ($.browser.msie) {
var range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if ($.browser.mozilla || $.browser.opera) {
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(text);
@round
round / bounce.js
Last active August 29, 2015 14:27
Increment a value up and down.
var up = true;
var value = 0;
var increment = 1;
var ceiling = 100;
var floor = -100;
if (up == true && value <= ceiling) {
value += increment
if (value == ceiling)
{up = false;}
@round
round / preferences.json
Created November 23, 2016 05:45
Emmet Config (single quote, closing comment with attribute)
{
"filter.commentAfter" : "<!--<%=attr('id', '#') %><%= attr('class', '.')%>-->"
}
@round
round / packages.json
Last active February 21, 2019 09:17
Atom Editor Custom Interface: Packages & User Styles
[
{
"name": "about",
"version": "1.10.0"
},
{
"name": "animated-page-scroll",
"version": "1.2.0"
},
{