This file contains 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 object_to_array($ob) | |
{ | |
if (!is_array($ob) AND !is_object($ob)) | |
{ | |
return $ob; | |
} | |
$ob = (array) $ob; | |
foreach ($ob AS $k => $v) |
This file contains 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 flatten_array($array, $parents = '') | |
{ | |
if ( !is_array($array) AND !is_object($array)) | |
{ | |
return array($parents . $array); | |
} | |
$array = (array) $array; | |
$flat = array(); | |
This file contains 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
<?php | |
function renderYaml($result, $prefix = '', $indentation = 0, $ptype = '') | |
{ | |
$result = json_decode(json_encode($result)); // convert key based arrays to objects | |
$indent = $prefix; | |
for ($c=0;$c<$indentation; $c++) { | |
$indent = ' ' . $indent; |
This file contains 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
<?php | |
class Parser | |
{ | |
function parse($data) | |
{ | |
$result = array(); | |
preg_match_all('/\/\*\*\s*?\n(.*?)\*\/\s*?\n\s*?(?:public)\s*?function\s*?([a-z0-9_-]*?)\(/si', $data, $matches, PREG_SET_ORDER); |
This file contains 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
<?php | |
function lipsum($amount = 5, $punct = false) | |
{ | |
$words = ['lorem', 'ipsum','dolor','sit','amet,','consectetur','adipiscing','elit','praesent', | |
'iaculis','interdum','congue','cras','ac','dictum','nulla.','quisque','quis','neque', | |
'nibh','curabitur','consequat','scelerisque','magna,','in','lacinia','nibh', | |
'scelerisque','eget','in','sed','ante','sit','amet','sem','cursus','mollis', | |
'quisque','venenatis','velit','nec','felis','varius','eu','auctor','odio', | |
'scelerisque.','nullam','id','enim','leo','donec','eu','ipsum','non','lectus','dapibus']; |
This file contains 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
translation.override | |
Current Value: { | |
"Projects" : "Tags", | |
"Project" : "Tag", | |
"Type a project name..." : "Type a tag name...", | |
"Create a New Project" : "Create a New Tag", | |
"Create New Project" : "Create New Tag", | |
"Create Project" : "Create Tag", | |
"Associate Projects" : "Add Tags", |
This file contains 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
// ==UserScript== | |
// @name YouTrack show agile estimation totals | |
// @namespace http:// | |
// @version 0.1 | |
// @match http://*.myjetbrains.com/*/agile/* | |
// ==/UserScript== | |
function run() { | |
$(".sb-column").each(function(index) |
This file contains 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() | |
{ | |
var selection = ko.views.manager.currentView.selection; | |
if (selection == "") return; | |
function convert() | |
{ | |
selection = selection.replace(/\<\%/g, '<%'); | |
selection = selection.replace(/\%\>/g, '%>'); |
This file contains 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
api.macro.register({ | |
id: "executeAsPHP", | |
execute: function() { | |
var selection = api.editor.getSelectedContents() || api.editor.getEditorContents(); | |
var tempFile = api.files.writeTempFile(selection); | |
api.commands.executeAndOutput("php -d display_errors=true " + tempFile.path); | |
}, |
This file contains 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
new function() | |
{ | |
/** | |
* Execute Macro | |
* | |
* @returns {void} | |
*/ | |
this.exec = function() | |
{ |
OlderNewer