Skip to content

Instantly share code, notes, and snippets.

View gmile's full-sized avatar
🦆
Poco a poco cresc.

Ievgen Pyrogov gmile

🦆
Poco a poco cresc.
View GitHub Profile
require 'pry'
require 'ffaker'
require 'active_record'
database = 'test'
config = {
adapter: 'mysql2',
encoding: 'utf8',
username: 'root',
  1. Format the USB with "Master boot record set", providing it with a "MYDISK" title (see 1, 2)
  2. run diskutil list
Eugenes-MacBook-Pro:haystack gmile$ diskutil list
/dev/disk0
 #:                       TYPE NAME                    SIZE       IDENTIFIER
 0:      GUID_partition_scheme                        *750.2 GB   disk0
 1:                        EFI                         209.7 MB   disk0s1
 2:                  Apple_HFS Macintosh HD            749.3 GB   disk0s2
package main
import "net"
import "bufio"
func main() {
conn, err := net.Dial("tcp", ":8080")
if err != nil {
println("There was an error:", err)
package main
import "net/rpc"
type Region struct {
X, Y int
}
func main() {
client, _ := rpc.Dial("tcp", ":8080")
package main
import (
client "ttt_client"
)
func main() {
game := new(client.Game)
game.Join() // should be game.Join('127.0.0.1', ':1234')
}
@gmile
gmile / archive_a_folder.sh
Last active December 20, 2015 14:39
Collection of shell scripts
tar -czf folder_name.tar.gz folder_name/

Once upon a very long time ago we did a project to compare the efficiency of Erlang to PLEX.

We implemented "the same things" (TM) in Erlang and PLEX and counted total man hours

We did this for several different things.

Erlang was "better" by a factor of 3 or 25 (in total man hours) - the weighted average was a factor 8

They asked "what is the smart programmer effect"

{
"post": {
"id": 1,
"title": "New post",
"body": "A body!",
"comment_ids": [ 1, 2 ]
},
"comments": [
{ "id": 1, "body": "what a dumb post", "tag_ids": [ 1, 2 ] },
{ "id": 2, "body": "i liked it", "tag_ids": [ 1, 3 ] },
require 'dry-data'
module Types
end
Dry::Data.configure do |config|
config.namespace = Types
end
Dry::Data.finalize
@gmile
gmile / steps.md
Last active March 5, 2016 14:19
investigation
(lldb) process attach --pid 1958
Process 1958 stopped
* thread #1: tid = 0x6f0f, 0x00007fff8f722d16 libsystem_kernel.dylib`__open + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff8f722d16 libsystem_kernel.dylib`__open + 10
libsystem_kernel.dylib`__open:
->  0x7fff8f722d16 <+10>: jae    0x7fff8f722d20            ; <+20>
    0x7fff8f722d18 <+12>: movq   %rax, %rdi
    0x7fff8f722d1b <+15>: jmp    0x7fff8f71dc02            ; cerror
 0x7fff8f722d20 &lt;+20&gt;: retq