Skip to content

Instantly share code, notes, and snippets.

View aslamanver's full-sized avatar
🎯
Focusing

Aslam Anver aslamanver

🎯
Focusing
View GitHub Profile
@aslamanver
aslamanver / README.md
Created December 19, 2018 06:47 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@aslamanver
aslamanver / ajax.js
Last active January 30, 2019 06:10
Reqres.in
$.ajax({
url: "https://reqres.in/api/users",
type: "POST",
data: {
name: "paul rudd",
movies: ["I Love You Man", "Role Models"]
},
success: function(response){
console.log(response);
}
@aslamanver
aslamanver / nativejs.js
Created January 30, 2019 06:12
Reqres.in
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://reqres.in/api/products/3", true);
xhr.onload = function(){
console.log(xhr.responseText);
};
xhr.send();
{
"name":"paul rudd",
"movies[]":[
"I Love You Man",
"Role Models"
],
"id":"243",
"createdAt":"2014-10-18T12:09:05.255Z"
}
{
"data":{
"id":3,
"name":"true red",
"year":2002,
"pantone_value":"19-1664"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://stackoverflow.com/sitemap-questions-0.xml</loc>
</sitemap>
<sitemap>
<loc>https://stackoverflow.com/sitemap-questions-1.xml</loc>
</sitemap>
<sitemap>
<loc>https://stackoverflow.com/sitemap-questions-2.xml</loc>
@aslamanver
aslamanver / clipboard.js
Created March 15, 2019 09:09
Copy Strings to the Clipboard using pure JavaScript
function copyStringToClipboard (str) {
// Create new element
var el = document.createElement('textarea');
// Set value (string to be copied)
el.value = str;
// Set non-editable to avoid focus and move outside of view
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
// Select text inside element
@aslamanver
aslamanver / autossh.service
Created March 15, 2019 11:34 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)

Create container

  1. docker run -dt --network host --name mycontainer ubuntu:18.04
  2. docker exec -it mycontainer /bin/bash

Mount volumes

  1. docker run -dt --network host --name mycontainer -v "$PWD":/home mycontainer-2
sudo apt-get update
sudo apt-get install apache2
sudo ufw allow in "Apache Full"
sudo apt-get install curl
sudo apt-get install mysql-server
mysql_secure_installation
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
sudo systemctl restart apache2