View file_list.cpp
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
#include <iostream> | |
#include <filesystem> | |
#include <string> | |
#include <fstream> | |
namespace fs = std::filesystem; | |
using std::cout; | |
const std::string outFilePath = "/home/allapow/Downloads/fileAudit.csv"; |
View arrayToCSV.js
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 arrayToCSV (twoDiArray) { | |
// Modified from: http://stackoverflow.com/questions/17836273/ | |
// export-javascript-data-to-csv-file-without-server-interaction | |
var csvRows = []; | |
for (var i = 0; i < twoDiArray.length; ++i) { | |
for (var j = 0; j < twoDiArray[i].length; ++j) { | |
twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas | |
} | |
csvRows.push(twoDiArray[i].join(',')); | |
} |
View formData-put.html
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
<div class="w3-row"> | |
<div class="w3-col w3-center"> | |
<form name="my_form" id="my_form"> | |
<input type="text" name="foo" value="12345gfd"> | |
<input type="text" name="bar" value="1234sdfghjzt5gfd"> | |
<button type="button" id="foobutton">doit</button> | |
</form> | |
</div> | |
</div> | |
<script type="application/javascript"> |
View zend-code_bad-example.php
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 | |
/** | |
* @param FolderTool $folderTool | |
* @return bool | |
*/ | |
public function createType_zendWay(FolderTool $folderTool): bool | |
{ | |
$filePath = $this->directory . '/' . $this->classname . '.php'; | |
$file = new \Zend\Code\Generator\FileGenerator(); | |
$file->setFilename($filePath); |
View datatables_sort_date.php
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 | |
forech($datas as $data) { | |
echo '<td data-sort="' . date('Y-m-d', $data['unixtimefield']).'">' . date('d.m.Y', $data['unixtimefield']) . '</td>'; | |
} |
View image_encode_base64.php
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 | |
$filename = 'anhaenger.jpg'; | |
//$filename = 'anhaenger.png'; | |
$path = 'img/' . $filename; | |
$type = pathinfo($path, PATHINFO_EXTENSION); | |
$data = file_get_contents($path); | |
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); | |
file_put_contents('base64/' . substr($filename, 0, (strrpos($filename, '.'))), $base64); | |
echo $base64; |
View svg_from_file_with_d3.js
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
const fs = require('fs'); | |
const d3 = require('d3'); | |
const D3Node = require('d3-node'); | |
var jsdom = require('jsdom'); | |
const { JSDOM } = jsdom; | |
var contents = fs.readFileSync(__dirname + '/data/rectangle_100.svg', 'utf8'); | |
// console.log(contents); | |
const dom = new JSDOM(contents); | |
// console.log(dom.window.document.querySelector('svg').outerHTML); |
View multiple_namespaces_in_a_file.php
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 | |
namespace A { | |
$closure = function () { | |
echo __NAMESPACE__; | |
}; | |
} | |
namespace B { | |
$closure = function () { |
View zf2_controller-with-viewHelper.php
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 | |
namespace MyApp\Controller; | |
use Zend\Mvc\Controller\AbstractActionController; | |
use \Zend\View\Model\ViewModel; | |
use Zend\View\Model\JsonModel; | |
class IndexController extends AbstractActionController | |
{ |
NewerOlder