Skip to content

Instantly share code, notes, and snippets.

@carlosescri
carlosescri / 0001-PHP-5.6-LibSSL-1.1-compatibility.patch
Last active May 20, 2020
This is a backup of a patched formula to install PHP 5.6 in Mac OS X Catalina.
View 0001-PHP-5.6-LibSSL-1.1-compatibility.patch
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
@carlosescri
carlosescri / .profile
Last active Oct 22, 2018 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
View .profile
GPG_TTY=$(tty)
export GPG_TTY
@carlosescri
carlosescri / shadows.scss
Created May 24, 2016 — forked from paulmelnikow/shadows.scss
Sass Mixin: Google Material Design Shadow
View shadows.scss
/**
* 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)
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active Apr 8, 2021
Minimal Working example of Elasticsearch scrolling using Python client
View gist:146ce50807d16fd4a6aa
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@carlosescri
carlosescri / gist:9109848
Last active Feb 13, 2020
Some commands to clean Ubuntu from trash, old kernels...
View gist:9109848
$ 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
@terkel
terkel / _decimal.scss
Last active Apr 17, 2021
Rounding decimals in Sass
View _decimal.scss
// _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
@dbarnett
dbarnett / jsonalchemy.py
Created Feb 3, 2012
JSONAlchemy: Proper JSON marshalling and mutation tracking in SQLAlchemy
View jsonalchemy.py
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
@kevinold
kevinold / git-flow_test.sh
Created Aug 19, 2010
testing git-flow on existing git repo
View git-flow_test.sh
# 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/