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 Lichess study enhancement | |
// @author Xatenev | |
// @match https://*.lichess.org/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log("Lichess study userscript loaded"); |
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
$ gcc -E main.c | ./filter.py > temp.c && ctags --c-types=f -x --file-scope=no temp.c | |
main function 25 temp.c int main(void) { | |
test function 17 temp.c int test() { |
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 | |
$db = new PDO("sqlite::memory:"); | |
$db->exec('CREATE TABLE test_table (test_column TEXT)'); | |
$stmt = $db->prepare('INSERT INTO test_table (test_column) VALUES (?)'); | |
$stmt->execute(array("val1")); | |
$stmt->execute(array("val2")); | |
$stmt->execute(array("val3")); | |
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
Input | |
Array1 = [1,2] | |
Array2 = [3,4] | |
Output | |
Array3 = [1,2,3,4] | |
Code | |
Array3 = Array1.concat(Array2); |
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
$args = array( | |
'orderby' => 'title', | |
'order' => 'ASC', | |
); | |
$wp_query = new WP_Query($args); ?> |
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
$downloadFields = explode(',', $this->settings['download']['fields']); | |
$contactFields = explode(',', $this->settings['contact']['fields']); | |
$fields = array(); | |
foreach($downloadFields as $field) { | |
$fields[] = array( | |
'field' => trim($field), | |
'type' => 'download' | |
); | |
} | |
foreach($contactFields as $field) { |
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 whoIncludedThisFile() { | |
$bt = debug_backtrace(); | |
$includedMe = false; | |
while (count($bt) > 0) { | |
$set = array_shift($bt); | |
if ( | |
array_key_exists('function', $set) === true && | |
in_array($set['function'], array('require', 'require_once', 'include', 'include_once')) | |
){ | |
$includedMe = array('file'=>$set['file'], 'line'=>$set['line']); |
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
foreach($articles->category->devices as $device) { // Iterate through all objects | |
foreach ($device as $key => $value) { // Iterate through all properties | |
if (!in_array($key, $allowedFields)) { // Find property in pre-defined array with the properties which are allowed for this object | |
unset($device->$key); // unset the properties which doesn't match the 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
set :typo3_maindir, '/html/typo3/' | |
set :php_cli, '/usr/local/bin/php_cli' | |
task :typo3_flushcache do | |
queue %[echo "------> TYPO3: flushing cache"]; | |
queue %[cd #{typo3_maindir} && rm -R typo3temp/*]; | |
queue %[ | |
cd #{typo3_maindir} && #{php_cli} -r ' | |
$GLOBALS["TYPO3_CONF_VARS"] = require(dirname(__FILE__)."/typo3conf/LocalConfiguration.php"); | |
$ac = dirname(__FILE__)."/typo3conf/AdditionalConfiguration.php"; | |
if(file_exists($ac)){ |
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($) { | |
$.QueryString = (function(a) { | |
if (a == "") return {}; | |
var b = {}; | |
for (var i = 0; i < a.length; ++i) | |
{ | |
var p=a[i].split('='); | |
if (p.length != 2) continue; | |
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); | |
} |
NewerOlder