Skip to content

Instantly share code, notes, and snippets.

View efazati's full-sized avatar
🎯
Focusing

Mohammad Efazati efazati

🎯
Focusing
View GitHub Profile
@efazati
efazati / i3rc
Created November 17, 2014 13:26
i3rc
#!/bin/bash
xrandr --output VGA1 --left-of HDMI1
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ir
feh --bg-fill ~/Pictures/background/wallpaper-base.jpg
@efazati
efazati / change_language.sh
Created August 17, 2014 07:01
change language with alt+shift setxkbmap
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ir
@efazati
efazati / convert_less.sh
Last active August 29, 2015 14:03
compile all less fiels
for file in *.less; do
lessc "$files" "${files%.less}.css"
done
@efazati
efazati / .Xdefaults
Created March 3, 2014 06:51
x defaults
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@efazati
efazati / jinja form_maker
Created February 22, 2014 07:28
jinja form_maker
{% macro form_maker(form, title) -%}
<div class='content_block_title'>{{ _("Form") }} {{title}}</div>
<div class="form ">
<form method="post" class="contact {% if form_class %}{{form_class}}{% endif %}" action="{{form.action}}" enctype="multipart/form-data" >
{% for field in form %}
{% if field.type == 'CSRFTokenField' %}
{{field}}
{% elif field.type == 'FieldList' %}
<h3>{{field.label}}</h3>
{{field}}
@efazati
efazati / i3config
Last active December 20, 2015 12:29 — forked from fzerorubigd/i3config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@efazati
efazati / template.py
Created January 18, 2013 08:32
some helper for template in flask
from functools import wraps
from flask import current_app, render_template, g, jsonify, redirect
def title(title=None):
def decorator(f):
@wraps(f)
def decorated_function(*args, **kwargs):
g.page_title = title
return f(*args, **kwargs)
@efazati
efazati / Py Flask Skeleton
Last active May 4, 2024 06:51
Python Flask Folders and Files structure
.
├── deploy.py
├── project
│   ├── application.py
│   ├── apps
│   │   ├── articles
│   │   │   ├── forms.py
│   │   │   ├── __init__.py
│   │   │   ├── models.py
│   │   │   └── views.py
@efazati
efazati / file_finder.py
Created January 8, 2013 15:20
very simple file finder.
import os
x = os.listdir('.')
result = []
for item in x:
if item.startswith("a"):
result.append(item)
print result
@efazati
efazati / persian.js
Created January 4, 2013 10:47
convert English number to Persian
$("body td").each(function(){
$(this).html(
$(this).html().replace(/\d/g, function(v) {
return String.fromCharCode(v.charCodeAt(0) + 0x06C0);
})
);
})