Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / pulse.css
Last active September 26, 2018 09:19
Pulse effect css style for html elements. just add the class to your element.
.pulse {
// margin:100px;
display: block;
width: 2px;
height: 2px;
border-radius: 50%;
background: transparent;
cursor: pointer;
@Ashkanph
Ashkanph / css-problems.css
Created May 13, 2017 07:18
Solution of common css problems
/* ---- when bootstrap modal pushes body to the left ------- */
body {
margin: 0 !important;
padding: 0 !important;
}
/* unset bs3 setting */
.modal-open {
@Ashkanph
Ashkanph / About Linux.sh
Last active May 6, 2017 13:37
Useful tips about Linux Ubuntu برخی از نکات کوچک و مفید برای لینوکس اوبونتو
# در ترمینال -------------------------------
# Ctrl + a یا Home رفتن به اول سطر
# Ctrl + k پاک کردن از جای فعلی تا آخر سطر
# Ctrl + u پاک کردن از جای فعلی تا اول سطر
# Ctrl+a Ctrl+k پاک کردن تمام سطر
# Ctrl + e یا End رفتن به آخر سطر
# Ctrl + Alt + Delete رستارت سیستم
# Ctrl + l پاک کردن کل ترمینال به غیر از خطی که در آن هستیم
@Ashkanph
Ashkanph / replaceAt.js
Created April 30, 2017 07:51
A prototype javascript function to change (replace) a character in a string
String.prototype.replaceAt=function(index, character) {
return this.substr(0, index) + character + this.substr(index+character.length);
};
# Aliases added by Ashkan -------------------------------
#
# Must install jcal
alias acal="echo '';echo '';jcal -3 -e; cal -3;echo '';echo '';date '+%A %Y/%B/%d %H:%M:%S%n';jdate '+%A %Y/%B/%d %H:%M:%S%n';"
# End of aliases added by Ashkan ------------------------
@Ashkanph
Ashkanph / current-datetime.js
Created April 19, 2017 13:54
Get the current datetime with javascript
/*
* Add this for jalali calendar:
* <script src="http://rawgithub.com/babakhani/PersianDate/master/dist/0.1.8/persian-date-0.1.8.min.js">
*
*/
var dateSeperatorCharacter = '-';
function currentDateTime(){
var cdt = {};
@Ashkanph
Ashkanph / combined-icons.scss
Created April 19, 2017 13:38
Combining two font awesome icons
/*
* Use it in pug:
*
* span.fa-stack.combined-icons
* i.fa.fa-map.fa-stack-2x.awesomeEntity
* i.fa.fa-heartbeat.fa-stack-1x.awesomeAction
*/
.combined-icons{
display: block;