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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.4.22 <0.9.0; | |
library console { | |
address constant CONSOLE_ADDRESS = | |
0x000000000000000000636F6e736F6c652e6c6f67; | |
function _sendLogPayloadImplementation(bytes memory payload) internal view { | |
address consoleAddress = CONSOLE_ADDRESS; | |
/// @solidity memory-safe-assembly |
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
angular.module('date-time-filter') | |
.filter('dateTimeFilter', () => input => 'string' === typeof input ? input.replace(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})Z$/, '$1 $2') : input); |
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(); | |
}); | |
}; |
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
-- 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
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
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
// 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
#!/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
/** | |
* Inheritance in ES5 | |
* @author Kichrum | |
*/ | |
var inherit = function(Parent) { | |
var Child = function(){ Parent.apply(this, arguments) } | |
Child.prototype = Object.create(Parent.prototype) | |
return Child | |
} |
NewerOlder