Skip to content

Instantly share code, notes, and snippets.

View the-teacher's full-sized avatar
💻
Working remotely

Ilya N. Zykin the-teacher

💻
Working remotely
View GitHub Profile
@the-teacher
the-teacher / test.js
Created April 26, 2019 19:13
ErrorArticle
const SystemError = ({ error }) => {
console.warn(error.name)
console.warn(error.message)
return (
<div>
<h3>Sorry!</h3>
<p>Something went wrong. Please try again later.</p>
</div>
)
class TaskIsNotDone extends React.Component {
submitButtonHandler = makeTaskDoneMutation => {
return () => {
makeTaskDoneMutation({ variables: { taskId: this.props.taskId } })
}
}
onConpleted = data => {
this.props.taskIsDoneHandler()
}
class Task extends React.Component {
constructor(props) {
super(props)
this.state = {
taskIsDone: false
}
}
onCompletedHandler (data) {
@the-teacher
the-teacher / Notes
Created February 28, 2018 21:31
Notes
Empty
@the-teacher
the-teacher / donutchart.rb
Created March 15, 2017 08:27 — forked from evuez/donutchart.rb
Donut chart generator
def donut(data, size, thickness, background='#fff')
cx = cy = size / 2
radius = size / 2 - 2
sum = data.values.inject(:+)
dx = 0
dy = -radius
angle = -90
paths = ''
@the-teacher
the-teacher / init.rb
Created February 24, 2017 09:30
rails pront initializers
module TheApp
class Application < Rails::Application
def initializers
bootstrap = Bootstrap.initializers_for(self)
railties = super
finisher = Finisher.initializers_for(self)
if Rails.env.development?
print_initializers(bootstrap, "#BOOTSTRAP")
print_initializers(railties, "#RAILTIES")
@the-teacher
the-teacher / proftp.conf.default.md
Created December 19, 2016 08:26
proftp.default.conf
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
#

# Includes DSO modules
Include /etc/proftpd/modules.conf
@the-teacher
the-teacher / fix.md
Created October 10, 2016 10:41
Fix for `ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed`
https://github.com/amatsuda/kaminari/issues/804
@the-teacher
the-teacher / shop_cart.rb
Created September 29, 2016 07:54
Shop GUID Algo
require 'digest/md5'
module ShopCartDigestGUID
private
def guid_generator
srand.to_s[1..12]
end
end