defmodule User do
defstruct [:id, :name, :role, :age]
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
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: gitlab | |
# Required-Start: $local_fs $remote_fs $network $syslog redis-server | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: GitLab git repository management | |
# Description: GitLab git repository management | |
### END INIT INFO |
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
upstream gitlab { | |
server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket; | |
} | |
server { | |
listen YOUR_SERVER_IP:80; | |
server_name gitlab.YOUR_DOMAIN.com; | |
root /home/gitlab/gitlab/public; | |
# individual nginx logs for this gitlab vhost |
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
import UIKit | |
class FloatingButtonController: UIViewController { | |
private(set) var button: UIButton! | |
required init?(coder aDecoder: NSCoder) { | |
fatalError() | |
} | |
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
#! /usr/bin/env elixir | |
ExUnit.start() | |
defmodule Ranges do | |
def run(indexes, length) do | |
ranges(indexes, length, nil, []) | |
end | |
# private |
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
defmodule Counter do | |
@type t :: %__MODULE__{count: integer()} | |
defstruct count: 0 | |
def transform(counter, %transformation_module{} = transformation) do | |
transformation_module.transform(counter, transformation) | |
end | |
end | |
defmodule Counter.Transformation do |
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
# 1024 bytes long string | |
string = """ | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis tempus iaculis erat. Cras orci enim, vulputate a elementum at, rutrum pulvinar sem. Donec gravida quam at lectus sagittis, eu facilisis felis scelerisque. Nulla quis leo quis ipsum sollicitudin pharetra. Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec bibendum porttitor hendrerit. In hac habitasse platea dictumst. | |
Sed blandit massa ut lorem accumsan, ut suscipit erat aliquet. Ut vulputate sit amet ligula non auctor. Nullam pharetra vestibulum velit, lobortis ultrices ante blandit quis. Curabitur gravida fringilla enim non pulvinar. Vestibulum facilisis turpis ipsum, ac tempor magna varius at. Cras pulvinar mi in varius mattis. Curabitur viverra nibh est, eu consectetur magna euismod eget. Suspendisse potenti. Vestibulum hendrerit auctor dui id imperdiet. Quisque congue enim non eros lobortis, rhoncus aliquam lacus eleifend. Nam et malesuada mauris, et semper velit. Aenean volutpat cursus or |
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
defmodule Mix.Tasks.Hex.Latest do | |
@doc """ | |
## Example usage: | |
`mix hex.latest jason` | |
Or you can copy the output with `pbcopy` like this: | |
`mix hex.latest jason | pbcopy` | |
""" |