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
// Hi Jack https://www.youtube.com/watch?v=f1FV6AELDmA | |
let jackGotDrunk=[]; | |
jackGotDrunk[197]='OoOPsie' | |
const AThousandJacks = (JSON.stringify(jackGotDrunk)+'....').replace(/./g,'Jack') | |
console.log(AThousandJacks) | |
console.log('Jack got drunk for how many times ?',AThousandJacks.match(/Jack/g).length) | |
console.log('Only Jack got drunk ?', AThousandJacks.length / "Jack".length === 1000 ? 'Yeee':'Neee') |
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
{ | |
"tags": [], | |
"host": "localhost:3000", | |
"schemes": [ | |
"http" | |
], | |
"info": { | |
"title": "Test API Documentation", | |
"version": "1.0.0" | |
}, |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#core_header_panel { | |
width: 300px; | |
height: 400px; | |
left: 550px; |
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
$reader = new XMLReaderToSimpleXML(); | |
$reader->open($filePath); | |
while($package = $reader->nextElement('Package')){ | |
parsePackage($package); // edit this to do the parsing stuff | |
} | |
class XMLReaderToSimpleXML extends XMLReader{ | |
function nextElement($tagName){ | |
while($this->read()){ |
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
var page = new WebPage(), | |
url = 'http://filipnet.ro', | |
stepIndex = 0; | |
page.onConsoleMessage = function (msg, line, source) { | |
console.log('console> ' + msg); | |
}; | |
page.onError = function(msg, trace) { |
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
server { | |
error_log /var/log/nginx/vhost-error_log warn; | |
access_log /usr/local/apache/domlogs/catalint.ro-bytes_log bytes_log; | |
listen 8.8.8.8:80; | |
server_name catalint.ro www.catalint.ro; | |
location @proxy { | |
proxy_pass http://8.8.8.8:81; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
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
<?php | |
$conf='/etc/nginx/vhosts/vhost.conf'; | |
$confFile=fopen($conf,'w'); | |
exec("find /var/cpanel/userdata/* -type f -not -name '*cache*' -not -name '*db' -not -name 'main' -not -name 'vhost*'",$ary); | |
foreach ($ary as $f){ | |
$fis=file_get_contents($f); | |
preg_match("@\ndocumentroot..(.*)@",$fis,$ROOT); | |
$ROOT=$ROOT[1]; | |
preg_match("@\nip..(.*)@",$fis,$IP); | |
$IP=$IP[1]; |
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
public function emptyDir($dir) { | |
$this->denyDelete(); | |
$dir = rtrim($dir, "/"); | |
$files = scandir($dir); | |
array_shift($files); | |
array_shift($files); |
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
<?php | |
$list = array(); | |
$list[] = 'a'; | |
$list[] = 'b'; | |
$list[] = 'c'; | |
$list[] = 'd'; | |
return $list; |