Skip to content

Instantly share code, notes, and snippets.

View giuliandrimba's full-sized avatar
🥁

Giulian Drimba giuliandrimba

🥁
View GitHub Profile
<div class="profile">
<div
class="profile-image"
style="background: url('/images/<%= person.imgSrc %>') top center no-repeat; background-size: cover;"
></div>
<div class="profile-details">
<h1 class="profile-name">
<%- person.firstname %> <%- person.lastname %>
</h1>
import Assets from 'assets-manager';
Assets.addQueue('general', appData.assets.general)
Assets.addQueue('intro', appData.assets.intro)
Assets.addQueue('projects', appData.assets.projects)
// No layout.js, chamamos:
Assets.start('general');
// No intro.js, chamamos:
{
'general': [
'path/to/file.jpg',
'path/to/file2.jpg'
'path/to/file3.jpg'
],
'intro': [
'path/to/file.jpg',
'path/to/file2.jpg'
'path/to/file3.jpg'
// Function to disable "pull-to-refresh" effect present in some webviews.
// Especially Crosswalk 12 and above (Chromium 41+) runtimes.
window.addEventListener('load', function() {
var lastTouchY = 0 ;
var maybePreventPullToRefresh = false ;
// Pull-to-refresh will only trigger if the scroll begins when the
// document's Y offset is zero.
_get_images: (data, imgs=[])->
for prop, val of data
if /(jpg|png|gif)$/.test(data[prop])
imgs.push data[prop]
if Array.isArray(data[prop])
for c in data[prop]
@_get_images c, imgs
return imgs
@giuliandrimba
giuliandrimba / typo
Created February 24, 2015 21:45
Photoshop typography
letter_spacing($spacing)
letter-spacing: unit($spacing/1000, 'em');
font_size($size, $leading)
font-size $size
if $leading
line-height: unit(100 * ($leading / $size), "%")
module.exports = function(jObj) {
var obj;
obj = {
_y: 1000,
_x: 1000,
_opacity: 0,
dom: jObj
};
Object.defineProperty(obj, "y", {
get: function() {
@giuliandrimba
giuliandrimba / get-sprite-retina
Created August 29, 2014 17:57
SASS + Compass retina sprite mixin
@mixin get-sprite($imgs, $name, $resize : false)
{
$dimensions: true !default;
$clean-up: true !default;
$layout:vertical !default;
$map: sprite-map($imgs, $layout: $layout, $cleanup: $clean-up, $spacing: 15px);
background: $map no-repeat;
@include sprite($map, $name, $dimensions, 0, 0);
@giuliandrimba
giuliandrimba / loopinfinito.htaccess
Created December 14, 2012 13:58
Apache: loopinfinito.com.br .htaccess
---
layout: none
permalink: .htaccess
---
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
@giuliandrimba
giuliandrimba / namespace.js
Created December 6, 2012 01:45
JavaScript: namespace helper
function namespace(name)
{
var namespaces = name.split(".");
var name = "";
function getName(parent)
{
if(namespaces.length > 0)
{
name = namespaces.shift();