Skip to content

Instantly share code, notes, and snippets.

View PabloVallejo's full-sized avatar

Pablo Vallejo PabloVallejo

View GitHub Profile
/**
* Components - Misc
*/
// Floating actions
.floating-actions {
width: 80px;
min-height: 150px;
margin-top: 15px;
@PabloVallejo
PabloVallejo / comment.insert.diff
Created August 2, 2013 19:55
comment controller
diff --git a/application/controllers/comment.php b/application/controllers/comment.php
index 099c043..70a8603 100644
--- a/application/controllers/comment.php
+++ b/application/controllers/comment.php
@@ -45,6 +45,7 @@ class Comment_Controller {
// 'comment_content' => wp_generate_password( 50, false, false )
'comment_content' => $req->content
, 'comment_post_ID' => $req->post_id
+ , 'comment_parent' => $req->parent_id
);
@PabloVallejo
PabloVallejo / app.js.global-events.diff
Created August 1, 2013 17:39
app.js.global-events
diff --git a/assets/js/handlers/comment.js b/assets/js/handlers/comment.js
index 4cd330d..bb08dd5 100644
--- a/assets/js/handlers/comment.js
+++ b/assets/js/handlers/comment.js
@@ -8,6 +8,12 @@
initialize: function() {
+ // Bind to global event `user.login`.
+ // window.Bppl.Event.on( 'user.login', this.functionToCall );
diff --git a/application/helpers/user.php b/application/helpers/user.php
index ce949c5..bf40944 100644
--- a/application/helpers/user.php
+++ b/application/helpers/user.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
*
* Helper functions are intended for being accessible
diff --git a/assets/js/helpers/utilities.js b/assets/js/helpers/utilities.js
index a34e884..21330fc 100644
--- a/assets/js/helpers/utilities.js
+++ b/assets/js/helpers/utilities.js
@@ -297,6 +297,18 @@
}
/**
+ * Converts a cammelcased string to dashed one one
+ * `sampleString`, `sample-string`
@PabloVallejo
PabloVallejo / multiple-assignment.php
Created July 25, 2013 20:16
Multiple assignment in PHP
<?php
// Multiple assignment
//--------------------
// Directly
list( $a, $b, $c ) = array( 1, 2, 3 );
diff --git a/assets/js/helpers/utilities.js b/assets/js/helpers/utilities.js
index a34e884..86ac187 100644
--- a/assets/js/helpers/utilities.js
+++ b/assets/js/helpers/utilities.js
@@ -297,6 +297,18 @@
}
/**
+ * Converts a cammelcased string to a spaced one.
+ * `sampleStringHere` => `sample string here`
diff --git a/assets/js/helpers/utilities.js b/assets/js/helpers/utilities.js
index a34e884..2922d1d 100644
--- a/assets/js/helpers/utilities.js
+++ b/assets/js/helpers/utilities.js
@@ -296,6 +296,19 @@
});
}
+
+ /**
@PabloVallejo
PabloVallejo / php.last-inserted-index.php
Created July 23, 2013 20:21
Get index of last inserted element in array
<?php
// Create array
$a = array();
// Add an item to it
$a[] = 1;
// Point to the last index of the array
end( $a );
@PabloVallejo
PabloVallejo / regexp.py
Created June 18, 2013 02:20
Python Regular expressions examples
import re
m = re.search('(?<=abc)def', 'abcdef')
# Getting first match
m.group(0) # -> 'def'
m = re.search('(?<=-)\w+', 'spam-egg')
m.group(0) # -> 'egg'