Skip to content

Instantly share code, notes, and snippets.

@Ashkanph
Ashkanph / interalButton.html
Created June 15, 2017 07:05
Add a button in an input text
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>InternalButton</title>
<style>
*{
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
@Ashkanph
Ashkanph / AboutLinux2.txt
Last active February 25, 2020 09:34
About Linux 2 (my pc at work)
Brightness controller -------------------------
sudo add-apt-repository ppa:apandada1/brightness-controller
sudo apt-get update
sudo apt-get install brightness-controller
-----------------------------
@Ashkanph
Ashkanph / dynamicSVGCanvasCharts.html
Last active September 11, 2017 06:31
canvas and svg with dynamic size
<!DOCTYPE html>
<html>
<body>
<div id="parent" style="width:50%; height:50px; background: yellow;">
<canvas id="canvas" width="300" height="170" style="border:1px solid #d3d3d3;">
<line x1="20" y1="0" x2="20" y2="50" style="stroke:rgb(0,0,0);stroke-width:5" />
Your browser does not support the HTML5 canvas tag.</canvas>
</div>
<br>
<br>
@Ashkanph
Ashkanph / my_vim_vscode_cheatsheet_settings.md
Last active January 19, 2019 07:28
My standard VIM (with no vim rc) and visual studio code cheatsheet

VIM Cheatshet

installing neovim

sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install neovim
@Ashkanph
Ashkanph / coockie.js
Created October 22, 2017 09:30
coockie.js
function setCookie(cname,cvalue) {
// function setCookie(cname,cvalue,exdays) {
var d = new Date(),
exdays = 7;
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
@Ashkanph
Ashkanph / Comma_Seperated_input.html
Created October 31, 2017 09:16
Comma Seperated input text numbers
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Comma Seperated input text numbers</title>
</head>
<body>
<br>
<input class="number">
@Ashkanph
Ashkanph / ixGplSassInstallationProblem.sh
Created February 12, 2018 07:16
To fix gulp-sass installation problem
sudo npm i gulp-sass -ES --unsafe-perm=true
@Ashkanph
Ashkanph / MyPHPProxy.php
Created June 30, 2018 13:11
My PHP proxy
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
//$ch = curl_init($_GET['url']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
@Ashkanph
Ashkanph / webWorkerInReactJs.js
Created August 20, 2018 09:59
Using web workers in react js
/* ------- worker file ----------
./worker/myworkercode.js
*/
const workercode = () => {
self.onmessage = function(e) {
// Do anything you want with e.data
let l = e.data * 5;
@Ashkanph
Ashkanph / ajax.md
Last active September 1, 2018 06:56
JQuery and pure javascript Ajax

jQuery

$.ajax('myservice/username', {
    data: {
        id: 'some-unique-id'
    }
})
.then(
    function success(name) {