Skip to content

Instantly share code, notes, and snippets.

View patadejaguar's full-sized avatar
💬
I need money

Luis Balam patadejaguar

💬
I need money
View GitHub Profile
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@insin
insin / index.html
Last active February 8, 2024 15:14
Export a <table> to Excel - http://bl.ocks.org/insin/1031969
<!DOCTYPE html>
<html>
<head>
<title>tableToExcel Demo</title>
<script src="tableToExcel.js"></script>
</head>
<body>
<h1>tableToExcel Demo</h1>
<p>Exporting the W3C Example Table</p>
@dannykopping
dannykopping / data.sql
Created October 8, 2011 16:01
Jaro-Winkler Blog Post data
# ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.1.44)
# Database: blog_tests
# Generation Time: 2011-10-08 18:00:24 +0200
@steveclarke
steveclarke / gist:1411146
Created November 30, 2011 21:54
Git: Setting up a Remote Repository and Doing Initial Push

Setup remote repository:

ssh git@example.com
mkdir my_project.git
cd my_project.git
git init --bare

On local machine:

cd my_project

@kennedyj
kennedyj / hex2bin
Created January 30, 2012 23:31
Convert Hex to Bin in bash
#!/bin/bash
if [ ! -n $1 ]; then
echo "Must specify a value"
exit 1
fi
for var in "$@"
do
code=`echo $var | tr 'a-z' 'A-Z'`
@ShaunSpringer
ShaunSpringer / grid.creator.css
Created April 2, 2012 21:55
A jQuery grid creator similar to MS Word's table creator.
.grid-block{
width: 50px;
height: 50px;
margin: 1px;
display: inline-block;
background-color: black;
-moz-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
user-select: none;
@crizCraig
crizCraig / gist:2816295
Created May 27, 2012 22:52
Download images from Google Image search using Python
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
from requests.exceptions import ConnectionError
def go(query, path):
"""Download full size images from Google image search.
@ykarikos
ykarikos / png2svg.sh
Created June 7, 2012 22:17
Convert png to svg using imagemagick and potrace
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then
@akhy
akhy / FTPuploader.php
Created June 24, 2012 10:38
PHP FTP Upload with Recursive Mkdir
<?php
/* PHP class for uploading file via FTP wich automatically make non-exist directory recursively */
<?php
class FTPUploader {
private static function make_directory($ftp_stream, $dir)
{
// if directory already exists or can be immediately created return true
if (FTPUploader::ftp_is_dir($ftp_stream, $dir) || @ftp_mkdir($ftp_stream, $dir)) return true;
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 22, 2024 23:19
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'