Skip to content

Instantly share code, notes, and snippets.

View DomenicoColandrea86's full-sized avatar
🎯
Focusing

Domenico Colandrea DomenicoColandrea86

🎯
Focusing
View GitHub Profile
@DomenicoColandrea86
DomenicoColandrea86 / dabblet.css
Created September 17, 2020 22:12
Triangle with Shadow
/*
Triangle with Shadow
*/
.triangle-with-shadow {
width: 100px;
height: 100px;
position: relative;
overflow: hidden;
//box-shadow: 0 16px 10px -17px rgba(0,0,0,0.5);
@DomenicoColandrea86
DomenicoColandrea86 / knex-pagination.js
Created July 3, 2018 18:53 — forked from andremsantos/knex-pagination.js
Adding pagination to knex.js
module.exports = function(dbConfig) {
var knex = require('knex')(dbConfig);
var KnexQueryBuilder = require('knex/lib/query/builder');
KnexQueryBuilder.prototype.paginate = function (per_page, current_page) {
var pagination = {};
var per_page = per_page || 10;
var page = current_page || 1;
if (page < 1) page = 1;
@DomenicoColandrea86
DomenicoColandrea86 / Index.js
Created June 22, 2017 15:33 — forked from fabriciovergara/Index.js
React-Navigation AuthFlow with Saga
import React from 'react'
import { connect } from 'react-redux'
import { redirect as redirectAction } from 'src/redux/auth/action';
class Index extends React.Component {
static propTypes = {
redirect: React.PropTypes.func.isRequired,
};

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update

@mixin font-stack($family, $weight, $size: inherit, $line-height: inherit, $style: normal, $stack: '"Lucida Grande", "Lucida Sans", Verdana, Helvetica, Arial, sans-serif') {
@if $weight >= 6 { -webkit-font-smoothing: antialiased; } // Sharpen up the bold text
font: {
@if $style == normal {
family: "#{$family} #{$weight}r", "#{$family} A", "#{$family} B", unquote($stack);
}
@else if $style == italic {
family: "#{$family} #{$weight}i", "#{$family} A", "#{$family} B", unquote($stack);
}
size: $size;
import org.gradle.api.tasks.Exec
defaultTasks 'bower'
// Get the path for the locally installed binaries
task npmBin << {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'npm'
args = ['bin']
@DomenicoColandrea86
DomenicoColandrea86 / compass sprites with retina support
Created July 28, 2014 05:10
automatically create image sprites with retina support using compass and scss!
@import "compass/utilities/sprites"; // Include compass sprite helpers
@import "compass/css3/background-size"; // Include helper to calc background size
// General Sprite Defaults
// You can override them before you import this file.
$icon-sprite-base-class: ".icon-sprite" !default;
$icon-sprite-dimensions: true !default;
$icon-spacing: 20px !default;
$icon-position: 0% !default;
#!/usr/bin/env python
# saved to ~/bin/batcharge.py and from
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]
define([
'marionette',
'templates'
], function(Marionette, Templates) {
var app = new Marionette.Application({
root: '/',
templates: Templates
});