Skip to content

Instantly share code, notes, and snippets.

@fcingolani
fcingolani / README.md
Created January 23, 2015 14:54
Formaggio. Simple MS SQL Server ORM for NodeJS. Built with Squel.

Formaggio

Simple MS SQL Server ORM for NodeJS. Built with Squel.

@fcingolani
fcingolani / README.md
Created December 31, 2014 20:42
Pachination. Simple pagination lib for Ruby

Pachination

Simple pagination lib for Ruby

Dependencies

  • Addressable
@fcingolani
fcingolani / HtmlHelperExtensions.cs
Last active June 18, 2016 11:14
Custom CachedPartial cache keys for Umbraco. Useful for pagination or dynamic ViewData. Oficially added on Umbraco 6.2.0. Based on https://github.com/umbraco/Umbraco-CMS/pull/143 and *internal* Umbraco 6.1.5 code.
namespace UmbracoExtensions
{
public static class HtmlHelperExtensions
{
public static IHtmlString CachedPartial(
this HtmlHelper htmlHelper,
string partialViewName,
object model,
int cachedSeconds,
@fcingolani
fcingolani / blackup.sh
Created November 21, 2013 20:04
Blackup. Simple filesystem and mysql database backup script. Usage: ./blackup.sh blackup_plan.sh
#!/bin/bash
# Requirements:
# - mysqldump
echo "Running backup plan $1";
source $1;
database_dump_file="$backup_dir/database.sql";
@fcingolani
fcingolani / generar_deploy.sh
Created November 18, 2013 16:31
Genera deploys de un directorio versionado con Git de manera simple. 1) Crear un directorio "deploy" dentro del proyecto y agregarlo al .gitignore 2) Copiar este script dentro del mismo. 3) ??? 4) Profit!!!!
#!/bin/bash
version=`date +%Y%m%d-%k%M%S`;
source_dir="..";
deploy_dir=`pwd`;
package_dir="$deploy_dir/$version/";
package_file="$deploy_dir/$version.zip";
echo "Generando deploy #$version";
@fcingolani
fcingolani / package.json
Created September 30, 2013 20:45
Simple Node web server
{
"name": "servilin",
"version": "1.0.0",
"author": "Federico Cingolani <[email protected]>",
"keywords": [
"http",
"server"
],
"dependencies" : {
"connect" : "*"
@fcingolani
fcingolani / tapas.sh
Created August 24, 2013 19:53
Script para descargar todas las tapas de Clarín publicadas en http://tapas.clarin.com/
#!/bin/sh
base_url="http://tapas.clarin.com/tapa"
cy=1945
cm=08
cd=28
ty=`date +%Y`
tm=`date +%m`
@fcingolani
fcingolani / generate-wordpress-wxr.php
Created June 18, 2013 20:34
Generate a WXR file from shell. Intended for BIG WordPress installations.
<?php
error_reporting(E_ALL ^ E_NOTICE);
define( 'WXR_VERSION', '1.2' );
/**
* Generates the WXR export file for download
*
* @since 2.1.0
*
@fcingolani
fcingolani / import_csv_to_sqlite.php
Last active April 8, 2024 02:52
PHP function to import a CSV into an SQLite database. Creates a table if needed. Uses PDO.
<?php
function import_csv_to_sqlite(&$pdo, $csv_path, $options = array())
{
extract($options);
if (($csv_handle = fopen($csv_path, "r")) === FALSE)
throw new Exception('Cannot open CSV file');
if(!$delimiter)
$delimiter = ',';
@fcingolani
fcingolani / index.haml
Created November 11, 2012 17:12
HAML HTML5 Boilerplate
!!! 5
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
%html.no-js
<!--<![endif]-->
%head
%meta{ charset: "utf-8"}