Skip to content

Instantly share code, notes, and snippets.

@smmoosavi
smmoosavi / olfsm.py
Last active January 3, 2016 00:49
One line finite-state machine implementation
# State machine implementation:
olfsm = lambda Q, input, init: reduce(lambda o, i: o + (o[-1] if i not in Q[o[-1]] else Q[o[-1]][i]), input, init)
@smmoosavi
smmoosavi / commands.md
Last active August 29, 2015 14:11
Some useful commands

Some useful commands.

extract tar.gz files

tar -zxvf file.tar.gz

source

@smmoosavi
smmoosavi / README.md
Last active August 29, 2015 14:12
change keymaster.js lib behavior with inputs
@smmoosavi
smmoosavi / Git-Patch.md
Created April 21, 2015 04:29
Git patch

src:

git format-patch -n 021467b # commit hash

dist:

git am *.patch --committer-date-is-author-date
@smmoosavi
smmoosavi / README.md
Last active June 22, 2021 06:42
Python terminal colors
@smmoosavi
smmoosavi / utf8.py
Created May 24, 2015 12:50
UTF8 Python
# -*- coding: utf-8 -*-
@smmoosavi
smmoosavi / install-google-chrome.md
Last active March 14, 2018 03:42
Ubuntu 14.04 installing google chrome

When you got this error

$ sudo dpkg -i google-chrome-stable_current_amd64.deb 
sudo: unable to resolve host bayanca05
[sudo] password for bayan-ca-05: 
Selecting previously unselected package google-chrome-stable.
(Reading database ... 174654 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (43.0.2357.81-1) ...
@smmoosavi
smmoosavi / readme.md
Created September 13, 2015 18:42
Docker commands

Remove all exsited dockers

$ docker rm $(docker ps -q -f status=exited)

source

Some tips for git

Rename branch

git branch -m <oldname> <newname>

source

npm run build

commented webpack.optimize.UglifyJsPlugin

build/static/app/css/styles.css

._1gwPWr77dmf4i5iRBt9FXY {
  border-color: #1abc9c !important; }