Skip to content

Instantly share code, notes, and snippets.

View aratak's full-sized avatar
💾
Uncaught TypeError: [object Object] is not a function

Alexey Osipenko aratak

💾
Uncaught TypeError: [object Object] is not a function
View GitHub Profile
@aratak
aratak / gist:1787951
Created February 10, 2012 09:11
dataurl for image
('HTMLCanvasElement' in this) && (function () {
HTMLCanvasElement.prototype.trim = function (opts) {
opts = opts || {};
var
element = this,
bound = {
top: null,
left: null,
right: null,
curl https://raw.github.com/gist/1759759/711c192b8bff65fa63c65d715b5def6263be01c0/gistfile1.txt | xargs say -v Zarvox
@aratak
aratak / gist:1759759
Created February 7, 2012 13:48
temp
This Was A Triumph... I'm Making A Note Here: HUGE SUCCESS. It's hard to overstate... my satisfaction... Aperture Science...We do what we must... because we can...For the good of all of us... Except the ones who are dead.
@aratak
aratak / undefined.js
Created February 6, 2012 08:45
Defense undefined variable
"use strict";
Object.defineProperty(window, "undefined", {
value: void(0),
writable: false
});
@aratak
aratak / .gitignore
Created January 4, 2012 15:28
.gigignore for NodeJS
TAGS
REVISION
*.tmproj
*~
.DS_Store
.settings
.project
.tasks-cache
.svn
*DONOTVERSION*
@aratak
aratak / jquery.cookieenabled.js
Created December 14, 2011 09:46
is cookie enabled?
(function($) {
$.cookieEnabled = function () {
var key = 'testCookieEnabled';
var value = '1';
$.cookie(key, value, { path: '/' });
return $.cookie(key) == value;
};
$(document).ready(function(){
if( !$.cookieEnabled() ) {
@aratak
aratak / gist:978131
Created May 18, 2011 07:21
gem 'mysql2' for rails 3.0
# bundle config build.mysql2 --with-mysql-config='/usr/local/mysql/bin/mysql_config'
gem 'mysql2', '< 0.3' # in the Gemfile.lock
@aratak
aratak / gist:976589
Created May 17, 2011 14:33
All git authors
git log --format='%aN' | sort | uniq -c | sort -nr
@aratak
aratak / USER.sh
Last active September 5, 2015 10:34
sql script for rails db on production
sudo su
groupadd www
useradd aratak --shell /bin/bash --group www --home /home/aratak
mkdir /home/aratak
chown aratak:www /home/aratak
passwd aratak
# add username to AllowUsers /etc/ssh/sshd_config
# add `aratak ALL=(ALL) NOPASSWD:ALL` to the /etc/sudoers
sudo service ssh restart
@aratak
aratak / .gitignore
Last active September 5, 2015 02:44
full .gitignore
pkg
.bundle
.DS_Store
TAGS
REVISION
*.tmproj
*~
.settings
.project
.tasks-cache