Skip to content

Instantly share code, notes, and snippets.

@carlosescri
carlosescri / gist:5848477
Created Jun 24, 2013 — forked from paulirish/gist:2926904
SublimeLinter User Config (from Paul Irish)
View gist:5848477
{
"// my options for SublimeLinter " : "//",
"jshint_options" : {
"boss": true,
"browser": true,
"curly": false,
"devel": true,
"eqeqeq": false,
"eqnull": true,
"expr": true,
@carlosescri
carlosescri / gist:6363927
Created Aug 28, 2013
Create a datetime from a string in a given format.
View gist:6363927
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)
@carlosescri
carlosescri / xls2csv
Created Oct 21, 2013
Requires the xlrd library to read Excel 97 .xls files.
View xls2csv
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from os import path
from optparse import OptionParser
from xlrd import open_workbook
@carlosescri
carlosescri / commands.bash
Created Nov 23, 2013
Install timezones into MySQL server (linux)
View commands.bash
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
@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
@carlosescri
carlosescri / doofinder_script.html
Last active Aug 29, 2015
Use `doofinder_script.html` if your website has its own search box. If not, configure your Doofinder layer based on `doofinder_script_alt.html` (this version of the script will automatically create a search box for you at the top of the page). You will find the search engine ID in the Doofinder control panel. Go to "My Account > Search Engines".
View doofinder_script.html
<!-- START OF DOOFINDER SCRIPT -->
<script type="text/javascript">
var doofinder_script = '//cdn.doofinder.com/media/js/doofinder-4.latest.min.js';
(function(d,t){var f=d.createElement(t),s=d.getElementsByTagName(t)[0];f.async=1;
f.src=('https:'==location.protocol?'https:':'http:')+doofinder_script;
s.parentNode.insertBefore(f,s)}(document,'script')
);
if(!doofinder){var doofinder={};}
// More options: http://www.doofinder.com/developer/doofinder-layer
doofinder.options = {
@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)
@carlosescri
carlosescri / GIF-Screencast-OSX.md
Created Nov 8, 2016 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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:

View doofinder-add-to-cart-detail-extended.mustache
<div>
<button type="button" class="my-df-addtocart-btn" data-addtocart="{{id}}">
{{#translate}}Add To Cart{{/translate}}
</button>
</div>