Skip to content

Instantly share code, notes, and snippets.

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

Carlos Yakimov cyakimov

🏠
Working from home
  • Falabella
  • Santiago, Chile
View GitHub Profile
@cyakimov
cyakimov / visibility.js
Created June 20, 2011 16:01 — forked from niallkennedy/visibility.js
Page Visibility API visibility test using jQuery
var isVisible = false;
function onVisible() {
isVisible = true;
jQuery.getScript("http://www.google-analytics.com/ga.js");
}
if ( document.webkitVisibilityState === undefined || document.webkitVisibilityState === "visible" ) {
onVisible();
} else {
jQuery.bind( "webkitvisibilitychange", function() {
@cyakimov
cyakimov / description.txt
Created July 11, 2011 20:38 — forked from samueldana/description.txt
Server setup issue using Nginx, RVM, Ruby-1.9.1, and Thin
So, I'm setting up a new Ubuntu 10.04 server with nginx, RVM, Ruby-1.9.1, and Thin.
I got through installing nginx, RVM, ruby-1.9.1 without any problems.
Ruby-1.9.1 was installed using 'rvm install x';
I don't have a system Ruby (Which is what I've been doing previously).
I've also set the default ruby to 1.9.1 for myself and root.
I installed the thin gem using 'gem install thin'
I then installed thin to the system using
'thin install'
@cyakimov
cyakimov / nodejs.sh
Created August 13, 2011 20:06 — forked from crcastle/nodejs.sh
Node.js startup script for AWS EC2 Linux box
#!/bin/bash
# nodejs - Startup script for node.js server
# chkconfig: 35 85 15
# description: node is an event-based web server.
# processname: node
# server: /path/to/your/node/file.js
# pidfile: /var/run/nodejs.pid
#
@cyakimov
cyakimov / Steps to take
Created October 20, 2012 19:13 — forked from gerritwessels/Steps to take
Mac OSX Mountain Lion Brew, Nginx, PHP53 + FPM Setup & Configuration
Thanks to:
http://realityloop.com/blog/2012/07/03/nginx-mariadb-php-aegir-mac-os-x-optional-drush-5-works-mountain-lion
and
http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
--Fresh install Mountain Lion.
--Install XCode 4.4.2
--Install Command line utilities via Xcode
--Install Homebrew

How to use a PS3 controller on Mac OS X 10.7 (Lion)

  1. Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

/*
name: [File.Upload, Request.File]
description: Ajax file upload with MooTools.
license: MIT-style license
author: Matthew Loberg
requires: [Request]
provides: [File.Upload, Request.File]
credits: Based off of MooTools-Form-Upload (https://github.com/arian/mootools-form-upload/) by Arian Stolwijk

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@cyakimov
cyakimov / Vagrantfile
Last active August 29, 2015 14:22 — forked from dhrrgn/Vagrantfile
# ...
config.vm.provider :virtualbox do |v|
# ... Other stuff here
# Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
v.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
end
# ...