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
let os = substitute(system('uname'), "\n", "", "") | |
call plug#begin('~/.vim/plugged') | |
Plug 'morhetz/gruvbox' | |
Plug 'kassio/neoterm' | |
Plug 'janko-m/vim-test' | |
Plug 'benekastah/neomake' | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
Plug 'fishbullet/deoplete-ruby', { 'for': 'ruby' } |
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 <errno.h> | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "linked_list.h" | |
// Создает ноду с указателем на data | |
node_t *construct_node(void *data) { | |
// Выделяем память под ноду |
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 <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
char command[10000][256]; // Список команд по порядку | |
int sleep_index[10000][2]; // Массив с задержками перед запуском и индексами команды, которую следует запускать | |
int n; // количество команд |
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
package main | |
import "regexp" | |
import "strings" | |
/* TASK 1 | |
* | |
* Релизовать функцию, которая принимает на вход slice из чисел и возвращает | |
* slice в котором удалены все четные числа. |
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
var guid = function() { | |
var s4 = function() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4(); | |
} | |
var add_li = function(task_text) { |
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
SELECT * | |
FROM tickets | |
INNER JOIN ( | |
SELECT DISTINCT ON (ticket_id), ticket_id, first_message_response_time | |
FROM tags_tickets | |
INNER JOIN tags ON (tags_tickets.tag_id = tags.id) | |
ORDER BY ticket_id, first_message_response_time | |
) first_message_response_times | |
ON (tickets.id = first_message_response_times.ticket_id) | |
INNER JOIN ( |
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
class ApplicationRecord < ActiveRecord::Base | |
self.abstract_class = true | |
# Universal replacement for MySQL's ORDER BY FIELD(name, •values) | |
def self.order_by_field(field, values) | |
ordering_table_id = SecureRandom.urlsafe_base64 | |
ordering_table_rows = values.map.with_index { |value, index| "(#{value},#{index + 1})" } | |
joins( |
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
# String Interpolation | |
apples = 3 | |
oranges = 5 | |
fruit_summary = "I have #{apples + oranges} " + "pieces of fruit." | |
# Range Operator | |
names = %w(Anna Alex Brian Jack) | |
count = names.count() | |
(0..count - 1).each { |i| |