Skip to content

Instantly share code, notes, and snippets.

View carlosescri's full-sized avatar

Carlos Escribano carlosescri

View GitHub Profile
@carlosescri
carlosescri / GIF-Screencast-OSX.md
Created November 8, 2016 11:40 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@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
@carlosescri
carlosescri / php-switch.sh
Created April 27, 2020 09:19 — forked from rhukster/sphp.sh
Easy Brew PHP version switching
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
@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 / .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
<div>
<button type="button" class="my-df-addtocart-btn" data-addtocart="{{id}}">
{{#translate}}Add To Cart{{/translate}}
</button>
</div>
@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 / commands.bash
Created November 23, 2013 19:25
Install timezones into MySQL server (linux)
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
@carlosescri
carlosescri / xls2csv
Created October 21, 2013 11:17
Requires the xlrd library to read Excel 97 .xls files.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from os import path
from optparse import OptionParser
from xlrd import open_workbook
@carlosescri
carlosescri / gist:6363927
Created August 28, 2013 09:11
Create a datetime from a string in a given format.
import time
from datetime import datetime
def str_to_datetime(str_date, str_format="%Y-%m-%d %H:%M"):
""" Creates a datetime from a string in a given format. """
dt = time.strptime(str_date, str_format)
dt = time.mktime(dt)