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 FormData = require('form-data'); | |
const https = require('https'); | |
const zlib = require('zlib'); | |
async function rp(options) { | |
try { | |
// Check if options is a string URL | |
if (typeof options === 'string') { | |
options = { uri: options }; | |
} |
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
// Example usage | |
// Case 1 | |
// const last6 = str_mod(trim(), last(6)); | |
// console.log(last6(" test string ")); // returns "string" | |
// Case 2 | |
// console.log(str_mod(" test string ", trim(), last(6))); // returns "string" | |
const trim = () => { |
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 vscode = require('vscode'); | |
/** | |
* Macro configuration settings | |
* { [name: string]: { ... Name of the macro | |
* no: number, ... Order of the macro | |
* func: ()=> string | undefined ... Name of the body of the macro function | |
* } | |
* } | |
*/ |
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 path = require('path'); | |
const walkSync = (dir, callback) => { | |
const files = fs.readdirSync(dir); | |
files.forEach((file) => { | |
var filepath = path.join(dir, file); | |
const stats = fs.statSync(filepath); | |
if (stats.isDirectory()) { | |
walkSync(filepath, callback); |
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
import IEvent from "IEvent"; | |
import IEventListener from "IEventListener"; | |
export class EventEmitter | |
{ | |
private listeners: { [key: string]: IEventListener[] } = {}; | |
public on(event: Function, listener: IEventListener): void | |
{ | |
if (!this.listeners[event.name]) this.listeners[event.name] = []; |
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 | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'combine_consecutive_unsets' => true, | |
'method_separation' => true, | |
'no_multiline_whitespace_before_semicolons' => true, | |
'single_quote' => true, |
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 | |
use Backend\Classes\Controller; | |
use Illuminate\Http\Response; | |
class ApiController extends Controller { | |
protected $statusCode = Response::HTTP_OK; | |
public function setStatusCode($code) |
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
#!/bin/bash | |
sudo chown -R www-data:www-data * | |
sudo find . -type d -exec chmod 755 {} \; | |
sudo find . -type f -exec chmod 664 {} \; | |
sudo chmod -R g+s storage themes | |
sudo chmod -R ug+rwx storage themes |
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
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 | |
class CountryCodes | |
{ | |
private static $codes = array ( | |
'AF' => 'Afghanistan', | |
'AX' => 'Åland Islands', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', |
NewerOlder