This file contains hidden or 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 "byebug" | |
| class CharFieldKlass | |
| def initialize(*args) | |
| end | |
| def valid? | |
| end | |
| end |
This file contains hidden or 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 ( | |
| "testing" | |
| "github.com/stretchr/testify/assert" | |
| ) | |
| func TestMain(m *testing.M) { | |
| // before spec | |
| err := m.Run() |
This file contains hidden or 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 "http/server" | |
| class Users::Me | |
| include HTTP::Handler | |
| def call(context) | |
| return call_next(context) unless match?(context.request) | |
| STDOUT.puts "getting user info..." | |
| STDOUT.puts "done!" |
This file contains hidden or 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
| describe "Sign in" do | |
| context "anonymous user" do | |
| it "returns data in the specified format" do | |
| sign_in_as_anonymous | |
| expect(response).to match_response_schema("users/anonymous_detail") | |
| end | |
| end | |
| end |
This file contains hidden or 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
| { | |
| "type": "object", | |
| "required": ["user"], | |
| "properties": { | |
| "user" : { | |
| "type" : "object", | |
| "required" : [ | |
| "id", | |
| "token", | |
| "token_expired_at", |
This file contains hidden or 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
| ### Keybase proof | |
| I hereby claim: | |
| * I am azbshiri on github. | |
| * I am azbshiri (https://keybase.io/azbshiri) on keybase. | |
| * I have a public key whose fingerprint is 5576 2694 3AF1 4E42 5673 F3CD 3D40 840A 6E62 F2DE | |
| To claim this, I am signing this object: |
This file contains hidden or 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 <unistd.h> | |
| int | |
| tomat(int length, FILE *stdout_) | |
| { | |
| int remain = 0; | |
| while ((remain = (length -= 1)) != 0) | |
| { | |
| fprintf(stdout_, "00:%d\n", remain); |
This file contains hidden or 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
| # Given a user containing a `first_name` and a `last_name` methods, write a `handle` | |
| # method that returns a generated handle that follow the following rules: | |
| # - It must be preceded by an @ | |
| # - It must be all lowercase | |
| # - It contains the first letter of the first name, and all the letters of the last | |
| # name (for "John" "Doe", it'd be @jdoe) | |
| # - If the first name contains more than one name, get the first letter of each name | |
| # ("John Fitzgerald Wood" "Doe" becomes @jfwdoe) | |
| # - If the last name contains more than one name, get all the letters of the last one, | |
| # and the first letter of each other ("John" "Fitzgerald Wood Doe" becomes @jfwdoe) |
This file contains hidden or 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 bash | |
| bing_bg() { | |
| local host='http://bing.com' | |
| local path='HPImageArchive.aspx' | |
| local query="format=js&idx=${1:-0}&n=1&mkt=en-US" | |
| curl -s "$host/$path?$query" |\ | |
| jq --arg host "$host" -r '$host + .images[0].url' | |
| } |
This file contains hidden or 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> | |
| main() | |
| { | |
| int c; | |
| int len; | |
| len = 0; | |
| while ((c = getchar()) != EOF) | |
| { |