Skip to content

Instantly share code, notes, and snippets.

/docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>{{ title }}</title>
<script type="text/javascript">
location = "{{ return }}";
</script>
<link rel="image_src" type="" href="{{ image }}" />
@RDIFB0
RDIFB0 / parted.md
Last active October 28, 2015 13:16

Разметка

$ parted --align optimal /dev/vdb
(parted) mklabel gpt
(parted) mkpart primary ext2 0% 100%
(parted) mkfs -t ext4 /dev/vdb1

Монтирование

@RDIFB0
RDIFB0 / transient_clear.sql
Created October 26, 2015 15:58
Wordpress transient clear
DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_%');
DELETE FROM `wp_options` WHERE `option_name` LIKE ('_site_transient_%');
# Squid 3
auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/pass
auth_param basic children 5
auth_param basic realm ServerName
auth_param basic credentialsttl 24 hour
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl password proxy_auth REQUIRED
ssh user@host <<-'ENDSSH'
#commands to run on remote host
ssh user@host2 <<-'END2'
# Another bunch of commands on another host
wall <<-'ENDWALL'
Error: Out of cheese
ENDWALL
ftp ftp.secureftp-test.com <<-'ENDFTP'
test
test
@RDIFB0
RDIFB0 / nuget.md
Created August 31, 2015 07:38
Nuget reinstall package
Update-Package –reinstall <packageName>
@RDIFB0
RDIFB0 / iso-alpha2.js
Created July 14, 2015 11:33
Wikipedia alpha2 ISO country codes
var $table = $('table.wikitable:nth-child(25)');
var countries = [];
$table.find('tr').not(':first').each(function() {
var $tr = $(this);
var country = {};
country.Code = $tr.find('td:nth-child(1)').text();
country.Name = $tr.find('td:nth-child(2)').text();
countries.push(country);
});
JSON.stringify(countries);
var formData = new FormData($form.get(0));
var resp = $.ajax({
url: '/upload.php',
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false
});
<?php
// cURL
curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// PHP
stream_context_set_default(array(
'http' => array(