Skip to content

Instantly share code, notes, and snippets.

@nemrosim
nemrosim / commands
Last active August 27, 2019 18:53
[ANGULAR CLI] commands for cli #Angular #CLI
// vim: syntax=javascript
// angular, create new project named "doomsday"
ng new doomsday
// angular, generate component
ng g c welcome-component
ng g g - generate guard
ng g m products/product --flat -m app
@nemrosim
nemrosim / commands
Created August 27, 2019 18:59
[Windows CLI] commands #CLI
cd - create or move to directory
rm node-modules - remove
@nemrosim
nemrosim / basics
Last active August 28, 2019 10:36
[Ruby] basics #basics
// vim: syntax=ruby
#Array
adress = [1,2,3,4,5,6]
p adress
p adress[0]
new_adress = adress.reverse!
p new_adress
# Printto console
@nemrosim
nemrosim / commands
Last active August 29, 2019 16:49
[RubyCLI] cli commands #Ruby #CLI #RubyCLI
$ gem install rsense
// Create file
$ touch demo
//Run file
$ ruby demo.rb
// console interactive ruby
$ irb
@nemrosim
nemrosim / 1. $ rails API
Last active August 31, 2019 13:54
[Ruby on Rails CLI] commands
$ rails new api-project --api --no-sprockets -d postgresql
| | |
| v |
v NO Asset Pipeline |
only API v
use Postgresql as DB
$ rails generate model contact
$ rails g controller v1/contacts
@nemrosim
nemrosim / commands
Last active August 29, 2019 16:42
[GIT] #GIT
$ git -version
$ git config --global user.name "SomeUserName"
$ git config --global user.email "user#gmail.com"
$ git config
$ git config --list
// STARTER
$ git init
// ADD ALL
$ git add .
@nemrosim
nemrosim / status codes
Created September 2, 2019 09:02
[RAILS]
# http://billpatrianakos.me/blog/2013/10/13/list-of-rails-status-code-symbols/
const Url = use('url-parse')
const CLEARDB_DATABASE_URL = new Url(Env.get('CLEARDB_DATABASE_URL'))
@nemrosim
nemrosim / package.json
Last active March 27, 2020 17:11
added packages
"dependencies": {
...
"mysql": "2.18.1",
"url-parse": "1.4.7"
}
@nemrosim
nemrosim / users.spec.js
Created March 29, 2020 22:14
Test for creating new user route
const { test, trait } = use('Test/Suite')('User');
const User = use('App/Models/User');
trait('Test/ApiClient');
trait('Auth/Client');
trait('DatabaseTransactions');
test('create new user', async ({ assert, client }) => {
const EMAIL = 'test@gmail.com';
const PASSWORD = '123';