Skip to content

Instantly share code, notes, and snippets.

Avatar
🥁

Giulian Drimba giuliandrimba

🥁
View GitHub Profile
View gist:d0db225a7fadd7caed9de6f112548e3c
<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>
View gist:af033387a6d947f17669d6e43236a628
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:
View gist:b1edd0aa28b96a7df4ec7a11f180da15
{
'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'
View gist:c64c8a29fedee3a1363354c55e5dbe00
// 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.
View parse json
_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 Feb 24, 2015
Photoshop typography
View typo
letter_spacing($spacing)
letter-spacing: unit($spacing/1000, 'em');
font_size($size, $leading)
font-size $size
if $leading
line-height: unit(100 * ($leading / $size), "%")
View odom.coffee
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 Aug 29, 2014
SASS + Compass retina sprite mixin
View get-sprite-retina
@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 Dec 14, 2012
Apache: loopinfinito.com.br .htaccess
View loopinfinito.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 Dec 6, 2012
JavaScript: namespace helper
View namespace.js
function namespace(name)
{
var namespaces = name.split(".");
var name = "";
function getName(parent)
{
if(namespaces.length > 0)
{
name = namespaces.shift();