Skip to content

Instantly share code, notes, and snippets.

View nikolalsvk's full-sized avatar
🍍

Nikola Đuza nikolalsvk

🍍
View GitHub Profile
import React, { Component } from "react";
class ButtonWithoutBind extends Component {
state = { toggle: false }
toggleButton = () => {
this.setState(prevState => ({ toggle: !prevState.toggle }));
}
render() {
import React, { Component } from "react";
class ButtonWithoutBind extends Component {
constructor() {
super();
this.state = { toggle: false };
}
toggleButton = () => {
this.toggleButton = this.toggleButton.bind(this);
import React, { Component } from "react";
class ButtonWithBind extends Component {
constructor() {
super();
this.state = { toggle: false };
}
toggleButton() {
import React, { Component } from "react";
class ButtonWithBind extends Component {
constructor() {
super();
this.state = { toggle: false };
this.toggleButton = this.toggleButton.bind(this);
}

PostgreSQL

SSH into PostgreSQL

psql -h DB_URL -U DB_USER DB_NAME

Then you will be asked for a DB_USER's password.

@nikolalsvk
nikolalsvk / delete_aws_lambdas.rb
Created May 18, 2017 08:47
Delete batch of AWS Lambda function since UI doesn't support multi-select
for i in 0..100
puts "Deleting MyFunction#{i}"
system("aws lambda delete-function --function-name MyFunction#{i}")
end
{
"november-7-sites": [402, 405, 408, 411, 417, 423, 429, 435, 441, 447, 457, 463,
469, 479, 487, 493, 499, 505, 517, 523, 529, 536, 545, 551,
557, 563, 569, 576, 582, 588, 594, 602, 609, 617, 623, 629,
635, 641, 647, 653, 659, 665, 671, 677, 683, 689, 695, 704,
710, 716, 722, 728, 737, 743, 749, 755, 761, 767, 775, 781,
787, 793, 799, 805, 811, 817, 823, 831, 837, 843, 850, 856,
862, 868, 874, 880, 886],
"november-17-sites": [414, 418, 424, 430, 436, 442, 448, 458, 464, 470, 480, 488,
494, 500, 507, 518, 524, 531, 538, 546, 552, 558, 564, 570,
#!/usr/bin/env bash
echo "Installing erlang"
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
rm erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get -y install esl-erlang
echo "Installing elixir"
sudo apt-get -y install elixir
def receive_data
basic_info = params[:basicInfo]
contact_info = params[:contactInfo]
business_partner = BusinessPartner.new
contact_card = ContactCard.new
business_partner.contact_card = contact_card
business_partner.from_json(basic_info)
contact_card.from_json(contact_info)