Skip to content

Instantly share code, notes, and snippets.

View btbytes's full-sized avatar
🐎
🏈

Pradeep Gowda btbytes

🐎
🏈
View GitHub Profile
#!/Users/pradeep/grok/bin/python
# encoding: utf-8
"""
cms2yaki.py
Created by Pradeep Gowda on 2008-09-22.
Copyright (c) 2008 Pradeep Gowda. All rights reserved.
"""
import sys
@btbytes
btbytes / equations.py
Created April 21, 2009 18:30
A Yaki plugin to render mathematical equations using l2p http://redsymbol.net/software/l2p/
'''
Equations.py
A Yaki plugin to render mathematical equations using
l2p http://redsymbol.net/software/l2p/
Pradeep Gowda <pradeep@btbytes.com>
2009-04-21
'''
import yaki.Engine, yaki.Store
import urlparse, re
@btbytes
btbytes / make_table.py
Created May 4, 2009 16:25
Given a CSV file with a header row, and at-least one row of data, output a SQL `CREATE TABLE` statement by guessing the data type of the columns.
#!/usr/bin/env python
# encoding: utf-8
"""
make_table.py
Given a CSV file with a header row, and at-least one row of data,
output a SQL `CREATE TABLE` statement by guessing the data type of the columns.
Pradeep Gowda <pradeep@btbytes.com>
License: Public Domain
[buildout]
parts = python libs
develop = .
eggs = deadparrot
[libs]
recipe = zc.recipe.egg
eggs = zope.interface
[python]
'''
Author: mjmalone
https://twitter.com/mjmalone/status/1874036416
'''
import struct
import pytyrant
class QueryException(Exception): pass
#!/usr/bin/env python
from __future__ import with_statement
import os
import sys
import string
from string import Template
from config import *
from datetime import date
from textile import textile
@btbytes
btbytes / mysql2csv.sql
Created June 11, 2009 17:37
Export into a CSV file from MySQL
-- Export into a CSV file from MySQL
SELECT * from foologger
INTO OUTFILE '/tmp/rrr.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n';
where dfd=2 and logtime >= '2009-06-08 05:00:00' and logtime <='2009-06-08 17:00:00'
and qhr=1;

Getting started with Lua and C++

Step 1: Install Lua

$ sudo apt-get install libreadline5-dev
$ sudo apt-get install lua-5.1 liblua5.1-0-dev
@btbytes
btbytes / crosscompiling_to_arm.markdown
Created July 2, 2009 02:24
Cross compiling Lua for an ARM processor running OpenEmbedded (iPac 9302) using Ubuntu 9.04

Follow this guide

$ wget -c http://www.kegel.com/crosstool/crosstool-0.43.tar.gz
$ tar -zxf crosstool-0.43.tar.gz
$ cd crosstool-0.43
$ sudo apt-get install patch bison 
$ sudo apt-get install build-essential
$ sudo apt-get install flex

$ sudo apt-get install libreadline5-dev

@btbytes
btbytes / c_refresher_notes.markdown
Created July 10, 2009 19:09
Notes from "The C Book"

C Refresher Notes

Notes from The C Book.

Introduction

  • To use exit(), EXIT_SUCCESS and EXIT_FAILURE include stdlib.h.

Variables and Arithmetic