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
'use strict' | |
const Fs = require('fs') | |
const Path = require('path') | |
const Axios = require('axios') | |
async function downloadImage () { | |
const url = 'https://unsplash.com/photos/AaEQmoufHLk/download?force=true' | |
const path = Path.resolve(__dirname, 'images', 'code1.jpg') |
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 | |
$host = 'localhost'; | |
$database = 'database'; | |
$user = 'login'; | |
$pass = 'password'; | |
$charset = 'utf8'; | |
$dsn = "mysql:host=$host;dbname=$database;charset=$charset"; | |
$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
<?PHP | |
/** | |
* Spintax - A helper class to process Spintax strings. | |
* @name Spintax | |
* @author Jason Davis - https://www.codedevelopr.com/ | |
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/ | |
*/ | |
class Spintax | |
{ | |
public function process($text) |
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
/* source https://www.youtube.com/watch?v=UKi1NwqKCz8 | |
_aj7mu _r4e4p _95tat _o0442 | |
*/ | |
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict() |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name site.com www.site.com; | |
return 302 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; |
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
#!/usr/bin/python3 | |
#22/06/2017 17:17 | |
import telnetlib | |
import time | |
import os | |
import sys | |
import getpass | |
import pexpect | |
from telnetlib import Telnet | |
import datetime |
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 cfgFolder = './cfg/'; | |
const fs = require('fs'); | |
const outFile = './out.txt'; | |
fs.readdir(cfgFolder, (err, files) => { | |
files.forEach(file => { | |
fs.readFile(cfgFolder+file, 'utf8', (err, data) => { | |
if(err) throw err; | |
let pass = data.match(/(blabla.+)/i); | |
pass = pass[0].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
//in: 123������������������������� | |
//out: 123 | |
function cleanString(input) { | |
var output = ""; | |
for (var i=0; i<input.length; i++) { | |
if (input.charCodeAt(i) <= 127) { | |
output += input.charAt(i); | |
} | |
} | |
return output; |
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
package tasks | |
type Task struct { | |
Name string | |
} | |
func (t *Task) Finish() { | |
// what actually can finish the task | |
} |
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
#В зависимости от эмулятора терминала, нужно добавить в ~/.bashrc (.zshrc, etc), следующие строки: | |
export GOROOT=/usr/local/go | |
export GOPATH=$HOME/go | |
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin | |
#/usr/local/go - расположение самой инсталляции (может отличатся в зависимости от системы и в случае использования менеджера управления версиями) | |
#$HOME/go - расположение любой директории, в которой хотите хранить пакеты |
NewerOlder