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 <stdlib.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <assert.h> | |
pthread_mutex_t lock; | |
int counter = 0; | |
#define MAX_ITER 100000 |
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
require 'benchmark' | |
require 'digest' | |
require 'etc' | |
THREAD_NUMBER = Etc.nprocessors | |
def count_md5(id) | |
tmp = id.to_s | |
1_000_000.times { tmp = Digest::MD5.hexdigest(tmp) } | |
tmp |
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
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
# Uncomment for socket activation (see below) | |
# Requires=puma.socket | |
[Service] | |
# Foreground process (do not use --daemon in ExecStart or config.rb) | |
Type=simple |
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
some_function(From) -> From ! { reply, "Greetings" } end. | |
P = spawn(some_function(self())), | |
receive | |
{reply, Msg} -> Msg, | |
Msg -> io:format("~p~n", [Msg]) | |
after 5000 -> timeout | |
end. |
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
create_project = ::Panels::Prodege::Client::Requests::CreateProject | |
request = create_project.new( | |
project_id, | |
country_id: country_id, | |
project_url: project_url, | |
cpi: cpi, | |
loi: loi, | |
project_name: project_name | |
) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MAX_DATA 100 | |
struct StackElement { | |
struct StackElement *head; | |
char data[MAX_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
#БЫЛО | |
tier1.uniq_by!(&:id).sort_by! { rand }.sort_by! {|x| x.avatar_file_name.blank? ? 1 : 0} + | |
tier2.uniq_by!(&:id).sort_by! { rand }.sort_by! {|x| x.avatar_file_name.blank? ? 1 : 0} + | |
tier3.uniq_by!(&:id).sort_by! { rand }.sort_by! {|x| x.avatar_file_name.blank? ? 1 : 0} + | |
(instructors - tier1 - tier2 - tier3).uniq_by!(&:id).sort_by! { rand }.sort_by! {|x| x.avatar_file_name.blank? ? 1 : 0} | |
#СТАЛО | |
instructors = [tier1,tier2,tier3].inject {|result, x| result + tier_filter(x) } + | |
tier_filter(instructors - tier1 - tier2 - tier3) |
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 Alex | |
attr_accessor :users | |
def initialize | |
@users = [] | |
end | |
def add_user(user) | |
@users << user |
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
# Example config file /etc/vsftpd.conf | |
# | |
# The default compiled in settings are fairly paranoid. This sample file | |
# loosens things up a bit, to make the ftp daemon more usable. | |
# Please see vsftpd.conf.5 for all compiled in defaults. | |
# | |
# READ THIS: This example file is NOT an exhaustive list of vsftpd options. | |
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's | |
# capabilities. | |
# |
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
puts "unsafe" | |
$SAFE = 0 | |
eval ("#{gets()}") | |
puts "safe" | |
$SAFE = 1 |
NewerOlder