Skip to content

Instantly share code, notes, and snippets.

View JasonGiedymin's full-sized avatar
🏠
Working from home

Jason Giedymin JasonGiedymin

🏠
Working from home
View GitHub Profile
@JasonGiedymin
JasonGiedymin / Advanced Django 1.3.x+ Logging
Created March 25, 2011 18:47
A Django 1.3.x+ settings.py snippet with Advanced logging formatters using RFC 2822, TimedRotatingFileHandler, and a WatchedFileHandler.
#
# Advanced Django 1.3.x+ Logging
#
# Author:
# Jason Giedymin < jasong _[_a-t_]_ apache d-o-t org >
#
# Description:
# A Django 1.3.x+ settings.py snippet with Advanced logging formatters using RFC 2822,
# TimedRotatingFileHandler, and a WatchedFileHandler.
#
def bits(n):
'''Represent an integer as an array of binary digits.'''
bits = []
while n > 0:
n, bit = divmod(n, 2)
bits.append(bit)
bits.reverse()
return bits
def fib_fast(n):
@JasonGiedymin
JasonGiedymin / JavaScript.tmLanguage.snippet.xml
Created June 16, 2011 20:41
Coffee-Script JS Highlighting
...
<key>fileTypes</key>
<array>
<string>js</string>
<string>htc</string>
<string>jsx</string>
<string>coffee</string>
</array>
...
@JasonGiedymin
JasonGiedymin / blog_cygwin_node_npm_err.sh
Created June 17, 2011 13:11
Fixing Node.JS NPM "--no-same-owner" errors in Cygwin.
# File is named as '.sh' for highlighting. Don't actually run this (hash bang removed).
#
# First of all, you should stop using cygwin and just use a VM or install linux.
# By continuing you acknowledge the fact your a nut. :-D
#
# If your having errors with Cygwin and NPM install packages such as:
# npm ERR! tar "-mvxpf" "-" "--no-same-owner"
#
# Do the following:
@JasonGiedymin
JasonGiedymin / fast_fib.coffee
Created June 18, 2011 00:57
CoffeeScript Javascript Fast Fibonacci
###
Author: Jason Giedymin <jasong _a_t_ apache -dot- org>
http://www.jasongiedymin.com
https://github.com/JasonGiedymin
This CoffeeScript Javascript Fast Fibonacci code is
based on the python code from Robin Houston's blog.
See below links.
A few things I want to introduce in time are implementions of
@JasonGiedymin
JasonGiedymin / fast_inv_square.coffee
Created June 20, 2011 20:43
CoffeeScript Javascript Fast Inverse Square with Typed Arrays
###
Author: Jason Giedymin <jasong _a_t_ apache -dot- org>
http://www.jasongiedymin.com
https://github.com/JasonGiedymin
Appearing in the Quake III Arena source code[1], this strange algorithm uses
integer operations along with a 'magic number' to calculate floating point
approximation values of inverse square roots[5].
@JasonGiedymin
JasonGiedymin / README.md
Created July 2, 2011 01:32 — forked from bergie/README.md
Falsy Values tutorials
@JasonGiedymin
JasonGiedymin / titanium_studio_ini_speed.txt
Created July 6, 2011 03:09
Titanium Studio ini Speedups
Use this Titanium Studio ini file in place of your existing.
On OSX right click on the TitaniumStudio.app and choose 'Show Package Contents", then navigate to "Contents/MacOS/TitaniumStudio.ini" and edit the file.
<ini>
-startup
../../../plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.XXMaxPermSize
256m
@JasonGiedymin
JasonGiedymin / cygwin_ssl_cert_issue.txt
Created July 6, 2011 13:34
Cygwin SSL Cert Issues
# Getting these Errors?
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://<some site here>
# From this thread you need to install root certificates. Do the following:
cd /usr/ssl/certs
$ curl http://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}'
$ c_rehash