This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Working demo: https://jsfiddle.net/1r5f2cey/1/ | |
/* CSS | |
#board { | |
display: grid; | |
grid: repeat(3, 1fr) / repeat(3, 1fr); | |
grid-gap: 5px; | |
} | |
.space { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Keep delayed job workers running using systemd on ubuntu | |
# Usage | |
# Start "sudo systemctl start delayed_job@{0..3}" to start 4 worker instances | |
# Enable "sudo systemctl enable delayed_job@{0..3}" to enable 4 worker instances | |
# Restart "sudo systemctl restart delayed_job@{0..3}" to restart 4 worker instances | |
# Disable "sudo systemctl disable delayed_job@{0..3}" to disable 4 worker instances | |
# Stop "sudo systemctl stop delayed_job@{0..3}" to stop 4 worker instances | |
[Unit] | |
Description=Delayed Job Worker %i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
git_source(:github) do |repo_name| | |
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | |
"https://github.com/#{repo_name}.git" | |
end | |
gem 'rails', '~> 5.1.0' | |
gem 'pg', '~> 0.18' | |
gem 'puma', '~> 3.7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.fontFamily": "Hack, Consolas", | |
"editor.fontSize": 11, | |
"editor.renderIndentGuides": true, | |
"editor.renderWhitespace": "all", | |
"editor.minimap.enabled": true, | |
"editor.minimap.renderCharacters": false, | |
"editor.dragAndDrop": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "0.1.0", | |
"command": "cmd", | |
"isShellCommand": true, | |
"tasks": [ | |
{ | |
"isBuildCommand": true, | |
"taskName": "run tests", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
0 * * * * /bin/bash -c 'export PATH="$HOME/.rbenv/bin:$PATH" ; eval "$(rbenv init -)"; cd $HOME; ./script.sh >> $HOME/jobs.log 2>&1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev | |
cd | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Node* removeDuplicates(Node *head) { | |
if(head == nullptr) return head; | |
while(head->next != nullptr && head->data == head->next->data) { | |
auto dup = head->next; | |
head->next = dup->next; | |
delete dup; | |
} | |
removeDuplicates(head->next); | |
return head; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
#include <functional> | |
template<class T> | |
long long benchmark(std::function<void()> op) { | |
auto start = std::chrono::steady_clock::now(); | |
op(); | |
return std::chrono::duration_cast<T>(std::chrono::steady_clock::now() - start).count(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html><html><head></head><body></body></html> |
NewerOlder