Skip to content

Instantly share code, notes, and snippets.

View favrik's full-sized avatar
🏀

Favio Manriquez favrik

🏀
View GitHub Profile
<!DOCTYPE html><html><head><!--If you delete this tag, the sky will fall on your head--><meta content="width=device-width" name="viewport" /><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><title>Invitation Email</title><style type="text/css">/* -------------------------------------
GLOBAL
------------------------------------- */
* {
margin:0;
padding:0;
}
* { font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; }
img {
SELECT
`TABLE_SCHEMA`, -- Foreign key schema
`TABLE_NAME`, -- Foreign key table
`COLUMN_NAME`, -- Foreign key column
`REFERENCED_TABLE_SCHEMA`, -- Origin key schema
`REFERENCED_TABLE_NAME`, -- Origin key table
`REFERENCED_COLUMN_NAME` -- Origin key column
FROM
`INFORMATION_SCHEMA`.`KEY_COLUMN_USAGE` -- Will fail if user don't have privilege
WHERE
@favrik
favrik / ack.sh
Last active October 23, 2015 10:27
$ ack '^Drupal\\' -A 1 -B 1
module/src/Authentication/Provider/authentication-provider.php.twig
3-{% block file_path %}
4:Drupal\{{module}}\Authentication\Provider\{{class_name}}.
5-{% endblock %}
module/src/service-interface.php.twig
3-{% block file_path %}
4:Drupal\{{module}}\{{ class }}Interface.
5-{% endblock %}
@favrik
favrik / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@favrik
favrik / inline_entity_form.diff
Created May 28, 2015 23:07
Allow duplicate entities
diff --git a/public/profiles/ritualcleanse/modules/contrib/inline_entity_form/inline_entity_form.module b/public/profiles/ritualcleanse/modules/contrib/inline_entity_form/inline_entity_form.module
index 0e39c5d..490f00e 100644
--- a/public/profiles/ritualcleanse/modules/contrib/inline_entity_form/inline_entity_form.module
+++ b/public/profiles/ritualcleanse/modules/contrib/inline_entity_form/inline_entity_form.module
@@ -466,9 +466,15 @@ function inline_entity_form_field_widget_form(&$form, &$form_state, $field, $ins
}
$delta = 0;
- foreach (entity_load($settings['entity_type'], $entity_ids) as $entity) {
+ // Allow duplicate entities.
create_table "payments", force: true do |t|
t.integer "credit_card_id", default: 0, null: false
t.integer "order_id", default: 0, null: false
t.float "amount", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "authorization", limit: 510
end
Table "public.payments"
Column | Type | Modifiers
----------------+-----------------------------+-------------------------------------------------------
id | integer | not null default nextval('payments_id_seq'::regclass)
credit_card_id | integer | not null default 0
order_id | integer | not null default 0
amount | double precision | not null default 0::double precision
created_at | timestamp without time zone | not null
updated_at | timestamp without time zone | not null
authorization | character varying(510) | default NULL::character varying
@favrik
favrik / stub.php
Last active December 21, 2015 02:49
Using https://github.com/php-test-helpers/php-test-helpers we can rename functions to help unit testing. This is a utility function.
<?php
function stub_function($function) {
if (!function_exists($function)) {
// Create dummy function.
$string = 'function ' . $function . "() {}";
eval($string);
}
rename_function($function, $function . '_orig');
# -*- coding: utf-8 -*-
class ModeloDePresupuesto:
# Datos comerciales
titulo = "PRESUPUESTO"
encabezado_nombre = "Eugenia Bahit"
encabezado_web = "www.eugeniabahit.com.ar"
encabezado_email = "mail@mail.com"
# Datos impositivos
alicuota_iva = 21
@favrik
favrik / testor.info
Created June 29, 2013 23:15
testor.info
name = Testor
description = ''
package = Testor
core = 7.x
base theme = commerce_kickstart_theme
stylesheets[all][] = css/testor.css
; copied from commerce_kickstart_theme