Skip to content

Instantly share code, notes, and snippets.

View komplexb's full-sized avatar

Byron komplexb

View GitHub Profile
def get_page_in_section access_token
encoded_access_token = URI::escape(access_token)
params = {:params => {:select => 'title,contentUrl,links'}}
headers = {:content_type => "application/json", :Authorization => "Bearer #{encoded_access_token}", :params => {:select => 'title,contentUrl,links'}}
# debugger
response = RestClient.get PAGES_URL, headers
JSON.parse(response)
end
@komplexb
komplexb / dynamicListNavigation.js
Last active August 29, 2015 14:13
dynamic list navigation: used to toggle forward/backward; next/back on lists, galleries and similar constructs
function moveCarouselItems (isDirectionForward) {
var currentImage = parentObject.find('.current_image'),
carouselItems = parentObject.find('ul li'),
position = carouselItems.index(currentImage);
if (isDirectionForward === null || isDirectionForward === undefined )
isDirectionForward = true;
if(isDirectionForward) {
if(position < carouselItems.length - 1) {
var pointsObj = { N:0, E:90, S:180, W:270 };
var _getDegree = function (orientation) {
switch (orientation) {
case "N":
return 0;
case "E":
return 90;
case "S":
return 180;
@komplexb
komplexb / regex_href.txt
Last active August 29, 2015 14:07
regex: find and replace href tag
Seach String: href\=\".*\"\s
@komplexb
komplexb / svg-bg.html
Created September 9, 2014 07:31
faking svg as a background: when you embed svg as CSS background, you can't style the elements inside it with external css, this method attempts to do so alternatively
<div class="content">
<div class="background-image">
<!-- SVG MARKUP -->
</div>
</div>
<form id="provcon-form-email" target="_self" onsubmit="" action="javascript:postProvConToGoogleEmail()" style="display:none">
<div class="alert alert-dismissable alert-warning text-center">
Thanks!
<br>
If you tell us your e-mail address, someone from our team will get back to you very soon to explore how you can start saving!
</div>
<div class="form-group">
<label for="email" class="h4">Email</label>
<input
required="required"
@komplexb
komplexb / overflow.css
Created September 5, 2014 15:36
responsive: handling overflowing text in a table
.readmore-narrative p {
overflow: scroll;
max-height: 300px;
white-space: normal; // breaks lines as necessary to fill line boxes
}
@komplexb
komplexb / style.scss
Last active August 29, 2015 14:05
SASS for SVG icons with PNG fallback with pure CSS based on: http://www.callmenick.com/2014/04/02/svg-fallback-with-png/
@each $icon-name in email, twitter, linkedin {
@each $color in black, white {
.icon-#{$icon-name}-#{$color} {
background: url('../icons/#{$icon-name}-#{$color}.png');
background-image: url('../icons/#{$icon-name}-#{$color}.svg'), none;
}
}
}
@komplexb
komplexb / 0_reuse_code.js
Created March 6, 2014 14:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console