Skip to content

Instantly share code, notes, and snippets.

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

Alexander R Torrijos stormwild

🏠
Working from home
View GitHub Profile
@stormwild
stormwild / gist:4523890
Last active July 30, 2017 07:06
Javascript code organization
// http://www.slideshare.net/nzakas/scalable-javascript-application-architecture
// http://addyosmani.com/largescalejavascript/
// http://boilerplatejs.org/
// http://rmurphey.com/blog/2009/10/15/using-objects-to-organize-your-code/
// http://stackoverflow.com/questions/11842923/organizing-javascript-code
// http://stackoverflow.com/questions/247209/current-commonly-accepted-best-practices-around-code-organization-in-javascript
// http://msdn.microsoft.com/en-us/magazine/gg602402.aspx
// https://coderwall.com/p/b5jutw
// http://alexsexton.com/blog/2010/02/using-inheritance-patterns-to-organize-large-jquery-applications/
var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
};
var head = function(list) {
@stormwild
stormwild / disable_foreign_key_checks
Created May 7, 2013 02:11
Temporarily disable foreign key checks on MySQL
SET foreign_key_checks = 0;
DELETE FROM users where id > 45;
SET foreign_key_checks = 1;
@stormwild
stormwild / sql_safe_updates
Last active February 6, 2024 23:52
How to disable MySQL Safe Mode
UPDATE table_name SET bDeleted=0 WHERE name='xyz';
“You are using safe update mode and you tried to update a table without a WHERE clause that uses a KEY column.”
SET SQL_SAFE_UPDATES=0;
UPDATE table_name SET bDeleted=0 WHERE name='xyz';
SET SQL_SAFE_UPDATES=1;
#http://www.xpertdeveloper.com/2011/10/mysql-safe-update/
@stormwild
stormwild / show_table_columns
Created June 10, 2013 06:26
SHOW COLUMNS displays information about the columns in a given table. It also works for views as of MySQL 5.0.1.
#http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
SHOW COLUMNS FROM City;
// http://net.tutsplus.com/tutorials/php/from-procedural-to-object-oriented-php/
// http://us3.php.net/manual/en/functions.variable-functions.php
function foo() {
echo "This is foo";
}
function bar($param) {
echo "This is bar saying: $param";
}
HOW TO MAKE SYMBOLS WITH KEYBOARD
Alt + 0153..... ™... trademark symbol
Alt + 0169.... ©.... copyright symbol
Alt + 0174..... ®....registered ­ trademark symbol
Alt + 0176 ...°......degree symbol
Alt + 0177 ...±....plus-or ­-minus sign
Alt + 0182 ...¶.....paragr­aph mark
Alt + 0190 ...¾....fractio­n, three-fourths
Alt + 0215 ....×.....multi­plication sign
@stormwild
stormwild / css-comment-styles.css
Last active August 10, 2020 05:45
Sample comments for css
/* from initializr */
/* ==========================================================================
Author's custom styles
========================================================================== */
/* http://markdotto.com/2011/12/12/css-commenting-strategy/ */
/*
Filename
@stormwild
stormwild / links-to-zf2-modules
Last active December 22, 2015 01:28
ZF2 Modules