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 / 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
@cyakimov
cyakimov / sublime-settings
Created June 12, 2013 19:57
Sublime Text Settings
{
"auto_complete_commit_on_tab": false,
"bold_folder_labels": true,
"caret_style": "solid",
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"create_window_at_startup": false,
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store"

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
@cyakimov
cyakimov / gist:6456518
Created September 5, 2013 21:34
Allow apache user to exec a git pull command.

Change your PHP to run git via sudo

<?php `sudo git pull [email protected]:my-user/myrepo.git`; ?>

Then change your suoders to allow git to be run by the apache user:

nano /etc/sudoers

Add this to the EOF:

@cyakimov
cyakimov / gist:8010474
Created December 17, 2013 18:49
Horizontal line with text in the middle.
<style>
.divider {
width:100%;
text-align:center;
border-bottom: 1px solid #000;
line-height:0.1em;
margin:10px 0 20px;
}
.divider > span { background:#fff; padding:0 10px; }
</style>

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

@cyakimov
cyakimov / gist:bc2b1cdb3c7eb1d0cd9b
Created May 20, 2015 14:13
jQuery plugin for equal height elements
$.fn.setSameHeight = function () {
var arrHeights = this.map(function (i, el) {
return $(el).height();
});
var maxHeight = Math.max.apply(null, arrHeights);
this.height(maxHeight);
return this;

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