Skip to content

Instantly share code, notes, and snippets.

View dariubs's full-sized avatar
🐕
I love Scorched rice

Dariush Abbasi dariubs

🐕
I love Scorched rice
View GitHub Profile
@dariubs
dariubs / nginx.conf.default
Last active August 29, 2015 14:27 — forked from nishantmodak/nginx.conf.default
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@dariubs
dariubs / app.py
Created November 11, 2015 21:48
Flask intro - coderz
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()

Download and Install Vagrant http://www.vagrantup.com/ and VirtualBox https://www.virtualbox.org/ or VMware before beginning

#Set up Vagrant *this guide assumes the use of Mac OS X Mountain Lion on local machine and Ubuntu 12.04 LTS x64 on Vagrant box. It is compatible with many other distros but hasn't been tested.

##Step 1: Make and run box

vagrant init
vagrant box add <path to box directory or name according to https://vagrantcloud.com/>
vagrant up
require 'thor'
class Thoring < Thor
desc 'hi name', 'say hi to name'
def hi(name)
puts "Hi #{name}"
end
end
Thoring.start(ARGV)
@dariubs
dariubs / ibot-first.rb
Created October 15, 2016 23:41
ibot gem simple example
require 'ibot'
bot = IBot.new('mybot')
bot.add_group 'greeting'
bot.add_group 'goodby'
bot.add_pattern 'greeting', /hi/i
bot.add_pattern 'greeting', /hello/i
@dariubs
dariubs / hello.rb
Created October 16, 2016 11:04
Hello sinatra
require 'sinatra'
get '/' do
"سلام دنیا"
end
get '/noobi' do
"سلام نوبی"
end
@dariubs
dariubs / postgres.md
Created June 9, 2017 09:35
Postgres cheatsheet

List all tables of db:

\dt
@dariubs
dariubs / BookatreatLandingPorposal.md
Last active October 2, 2018 18:02 — forked from mohsenk/BookatreatLandingPorposal.md
change enum to array of items

Landing Page Porposal

Features

  • Ability to select diffrent templates
  • Ability to fill and change template variables ( like images and texts)
  • Ability to enable or disable any section or part of template
  • We can define templates that use handlebars syntax and save it to db or file system
  • Every template contains a config.json file and contains template configuration
  • A Template is consis of components and every component has props
media="none" onload="if(media!='all')media='all'"
@dariubs
dariubs / laravel-nginx-ubuntu-18.04.md
Last active May 22, 2019 14:00
Install and use laravel with ubuntu 18.04 step by step

Install and use laravel with nginx in ubuntu 18.04

Install PHP

You need to install PHP 7.1.3 or greater FPM version.

sudo apt install php7.2-fpm php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-cli php7.2-zip

Install nginx