Skip to content

Instantly share code, notes, and snippets.

View danest's full-sized avatar
😶

Kevin Urrutia danest

😶
View GitHub Profile
@danest
danest / gist:3001605
Created June 27, 2012 05:03 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@danest
danest / ruby_oauth_token_generator.rb
Created November 5, 2012 00:12 — forked from tsycho/ruby_oauth_token_generator.rb
Ruby Gmail OAuth token generator
require 'hmac-sha1'
require 'base64'
require 'cgi'
module OauthHelper
def URLEscape(text)
return CGI.escape(text).gsub("+", "%20")
end
@danest
danest / Custom.css
Created February 16, 2013 04:59 — forked from bentruyman/Custom.css
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@danest
danest / Log-.md
Created April 13, 2013 21:11 — forked from bgrins/Log-.md

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,

Template Components

Used to provide structural templates.

Pattern

t-template-name
t-template-name--modifier-name
t-template-name__subcomponent-name--subcomponent-modifier-name
# ** ERROR 1 **
# FATAL: lock file "postmaster.pid" already exists
# HINT: Is another postmaster (PID 4646) running in data directory "/usr/local/var/postgres"?
#
# ** ERROR 2 **
# Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
#
# To fix one of this errors:
cat /usr/local/var/postgres/postmaster.pid # pid is the number on first line
Somebody asked me how to become a Product Manager. Here's what I wrote them.
---------------------------------------------------------------------------
Hi Jon,
Those are a lot of questions. Let me try to simplify it.
I think a Product Manager is a person who is responsible for determining
what a product should be and how it should evolve. This is a design role
@danest
danest / gist:14e3da49d061c01b7aeb
Last active August 29, 2015 14:01 — forked from lucasfais/gist:1207002
Sublime Text 3 – Useful Shortcuts (Mac OS X) and Plugins

Sublime Text 3 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@danest
danest / how-to-set-up-stress-free-ssl-on-os-x.md
Created August 31, 2017 23:25 — forked from lostmahbles/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@danest
danest / move-proceed-to-checkout.php
Created September 8, 2017 20:34 — forked from BurlesonBrad/move-proceed-to-checkout.php
Put Checkout button next to the Update Cart button (AWESOME on mobile!!) https://bradgriffin.me/proceed-to-checkout/
add_action( 'woocommerce_cart_actions', 'move_proceed_button' );
function move_proceed_button( $checkout ) {
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>';
}