Skip to content

Instantly share code, notes, and snippets.

View Codcore's full-sized avatar

Andrej Yaroshuk Codcore

View GitHub Profile
RestClient::NotFound at /meet/tests.json
========================================
> 404 Not Found
app/services/openvidu/token.rb, line 4
--------------------------------------
``` ruby
1 module Openvidu
@Codcore
Codcore / capybara cheat sheet
Created October 2, 2019 07:21 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
### Nginx ###
check process nginx with pidfile /run/nginx.pid
start program = "/usr/sbin/service nginx start"
stop program = "/usr/sbin/service nginx stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if memory usage > 80% for 5 cycles then restart
if failed host 139.59.139.107 port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout
@Codcore
Codcore / hello_world.py
Created March 26, 2019 13:43
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@Codcore
Codcore / hello_world.py
Created March 26, 2019 10:58
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@Codcore
Codcore / hello_world.py
Created March 26, 2019 10:45
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@Codcore
Codcore / hello_world.py
Created March 25, 2019 21:50
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@Codcore
Codcore / hello_world.py
Created March 23, 2019 20:06
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@Codcore
Codcore / SQL
Last active February 25, 2019 14:27
1.)
test_guru=# CREATE TABLE categories (
test_guru(# id SERIAL PRIMARY KEY,
test_guru(# title TEXT
);
CREATE TABLE
rubycoder@shehinacode ~ $ ncat -C httpbin.org 80 [ruby-2.6.0]
GET /anything HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Thu, 21 Feb 2019 11:16:58 GMT
Server: nginx