This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/wp-content/plugins/relevanssi/lib/common.php b/wp-content/plugins/relevanssi/lib/common.php | |
index 5ac8d4b..a797aaa 100644 | |
--- a/wp-content/plugins/relevanssi/lib/common.php | |
+++ b/wp-content/plugins/relevanssi/lib/common.php | |
@@ -396,7 +396,7 @@ function relevanssi_get_custom_fields() { | |
return $custom_fields; | |
} | |
else { | |
- $custom_fields = explode(",", $custom_fields); | |
+ $custom_fields = explode("\n", $custom_fields); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* One more version of inheritance for ES3 | |
* @author Kichrum | |
*/ | |
var inherit = function(Parent) { | |
var Child = function(){ Parent.apply(this, arguments) } | |
// We can use | |
// Child.prototype = Object.create(Parent.prototype) | |
// here for ES5 instead of next 3 lines: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inheritance in ES5 | |
* @author Kichrum | |
*/ | |
var inherit = function(Parent) { | |
var Child = function(){ Parent.apply(this, arguments) } | |
Child.prototype = Object.create(Parent.prototype) | |
return Child | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#author : Kichrum | |
files=$(ls *.avi); | |
outputFolder="output/" | |
for file in $files | |
do | |
outputFile=${file//.avi/}; | |
printf "\n\n === Converting $file => $outputFile.mp4 === \n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helper function to inject a <script> tag. | |
function injectScript(url, onload, onerror) { | |
var script = document.createElement("script"); | |
// onload fires even when script fails loads with an error. | |
script.onload = onload; | |
script.onerror = onerror || onload; | |
script.src = url; | |
document.head.appendChild(script); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class File extends CActiveRecord | |
{ | |
public function rules() | |
{ | |
array('filename', 'file', 'types'=>'pdf, doc, docx, xls, xlsx, ods, odt, zip, rar, avi, mp4, flv, txt, webm', 'allowEmpty' => true), | |
); | |
} | |
/** | |
* Get file path by file name in database |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -r --no-parent http://site.com/songs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get AUTO_INCREMENT current value: | |
SELECT `AUTO_INCREMENT` | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_SCHEMA = 'DatabaseName' | |
AND TABLE_NAME = 'TableName'; | |
-- SET AUTO_INCREMENT value (this number will be user for NEXT inserted element): | |
ALTER TABLE `TableName` AUTO_INCREMENT = 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(angular) { | |
var addCustomValuesFilter = function () { | |
// string | addCustomValues : true : 1 : 2 | |
return function () { | |
var input = arguments[0], | |
shouldApplyFilter = arguments[1] !== false, | |
i, len, | |
values = [], | |
result = input; | |
if (shouldApplyFilter) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(angular) { | |
// 'camelCaseName' | camelCaseToCapitalized => 'Camel Case Name' | |
var camelCaseToCapitalizedFilter = function() { | |
return function(string) { | |
return string | |
.replace(/([A-Z])/g, ' $1') | |
.replace(/^./, function(str) { | |
return str.toUpperCase(); | |
}); | |
}; |
OlderNewer