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
import type { RouterConfig } from '@nuxt/schema' | |
// https://router.vuejs.org/api/#routeroptions | |
export default <RouterConfig>{ | |
scrollBehavior: (to, _from, savedPosition) => { | |
if (to.params?.stop) { | |
return | |
} | |
if (to.hash) { | |
const el = document.querySelector(to.hash) |
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
// jalali date | |
JalaliDate = { | |
month_names: ["فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"], | |
g_days_in_month: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], | |
j_days_in_month: [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29] | |
}; | |
JalaliDate.jalaliToGregorian = function(j_y, j_m, j_d) { | |
j_y = parseInt(j_y); | |
j_m = parseInt(j_m); | |
j_d = parseInt(j_d); |
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
"""Information Retrieval metrics | |
Useful Resources: | |
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt | |
http://www.nii.ac.jp/TechReports/05-014E.pdf | |
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf | |
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf | |
Learning to Rank for Information Retrieval (Tie-Yan Liu) | |
""" | |
import numpy as np |
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
/* usage: | |
* UIColor.randomColor() | |
*/ | |
extension UIColor { | |
class func randomColor() -> UIColor{ | |
let r:CGFloat = CGFloat(drand48()) | |
let g:CGFloat = CGFloat(drand48()) | |
let b:CGFloat = CGFloat(drand48()) | |
return UIColor(red: r, green: g, blue: b, alpha: 1.0) |
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
<span class="spinner"> | |
<i class="fa fa-chevron-up" onclick="var el = $(this).siblings('input')[0]; el.value = Math.min(5, parseInt(el.value)+1)"></i> | |
<input type="text" name="day" value="0"> | |
<i class="fa fa-chevron-down" onclick="var el = $(this).siblings('input')[0]; el.value = Math.max(0, parseInt(el.value)-1)"></i> | |
</span> | |
<style> | |
.spinner { | |
position: relative; | |
display: inline-block; | |
} |
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
# Persian Lorem Ipsum | |
'.text, .source': | |
'Lorem Ipsum': | |
'prefix': "لورم" | |
'body' : "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد." |
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
// usage {{ 122 | timer }} | |
.filter("timer", function () { | |
return function (time) { | |
var sec = time % 60, | |
min = parseInt(time/60) % 60, | |
hou = parseInt(time/3600) % 60 | |
sec < 10 && (sec = '0'+sec) | |
min < 10 && (min = '0'+min) | |
hou < 10 && (hou = '0'+hou) |
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
// | |
// Arrow for fabric.js | |
// | |
(function($){ | |
$.Arrow = $.util.createClass($.Line, $.Observable, { | |
initialize: function(e,t) { | |
this.callSuper("initialize", e, t) | |
this.set({type:'arrow'}); | |
}, | |
_render: function(e) { |