Skip to content

Instantly share code, notes, and snippets.

View carlosescri's full-sized avatar

Carlos Escribano carlosescri

View GitHub Profile
@carlosescri
carlosescri / shadows.scss
Created May 24, 2016 07:37 — forked from paulmelnikow/shadows.scss
Sass Mixin: Google Material Design Shadow
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Adapted from a LESS version at https://medium.com/@Florian/freebie-google-material-design-shadow-helper-2a0501295a2d
*
* Original Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
@carlosescri
carlosescri / .profile
Last active October 22, 2018 16:47 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
GPG_TTY=$(tty)
export GPG_TTY
@carlosescri
carlosescri / gist:9109848
Last active February 13, 2020 20:03
Some commands to clean Ubuntu from trash, old kernels...
$ sudo apt-get autoclean
$ sudo apt-get clean
$ sudo apt-get autoremove
# if you installed the debian-goodies package...
$ dpigs -H -n 25
# You can install ncdu to find large files in a graphical interface through terminal
$ ncdu
@carlosescri
carlosescri / 0001-PHP-5.6-LibSSL-1.1-compatibility.patch
Last active May 20, 2020 05:54
This is a backup of a patched formula to install PHP 5.6 in Mac OS X Catalina.
Subject: [PATCH] PHP 5.6 - LibSSL 1.1 compatibility
This patch does not try to backport the 7.1 openssl module, it is the
improved version of the 5.6 original openssl module.
https://github.com/oerdnj/deb.sury.org/issues/566
http://zettasystem.com/PHP-5.6.31-OpenSSL-1.1.0-compatibility-20170801.patch
Upstream-Status: Deny [https://github.com/php/php-src/pull/2667]
Reason: As PHP 5.6 is no longer actively supported only security fixes
@kevinold
kevinold / git-flow_test.sh
Created August 19, 2010 16:45
testing git-flow on existing git repo
# In reply to my own question
# (http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/#comment-69995567)
# about using git-flow with existing git repos I experimented with a dummy
# git repo and it appears rather straight-forward
kold@Macintosh-27 $ git init test_git_flow
Initialized empty Git repository in /private/tmp/test_git_flow/.git/
(/tmp)
kold@Macintosh-27 $ cd test_git_flow/
@dbarnett
dbarnett / jsonalchemy.py
Created February 3, 2012 15:10
JSONAlchemy: Proper JSON marshalling and mutation tracking in SQLAlchemy
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String
@terkel
terkel / _decimal.scss
Last active November 23, 2023 18:36
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active February 27, 2024 10:15
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})