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
| const builtin = @import("builtin"); | |
| const std = @import("std"); | |
| // This version won't read/print headers, just the response | |
| pub fn main() !void { | |
| var writer_buffer: [8 * 1024]u8 = undefined; | |
| var redirect_buffer: [8 * 1024]u8 = undefined; | |
| var writer = std.fs.File.stdout().writer(&writer_buffer); |
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
| const std = @import("std"); | |
| // Although this function looks imperative, note that its job is to | |
| // declaratively construct a build graph that will be executed by an external | |
| // runner. | |
| pub fn build(b: *std.Build) void { | |
| // Standard target options allows the person running `zig build` to choose | |
| // what target to build for. Here we do not override the defaults, which | |
| // means any target is allowed, and the default is native. Other options | |
| // for restricting supported target set are available. |
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
| # for Emacs: -*- coding: utf-8 -*- | |
| # | |
| # User-defined key sequences for WinCompose | |
| # by Sam Hocevar <[email protected]> | |
| # | |
| # Key sequences have the following form: | |
| # | |
| # <Multi_key> <key>… : "resulting text" | |
| # |
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
| defmodule Planet do | |
| defstruct [:x, :y] | |
| def gen_planet(x, y) do | |
| xr = rem x, 7 | |
| yr = rem y, 11 | |
| if x > 4 and y > 8 and xr > 3 and xr < 6 and rem(yr, xr) === 1 do | |
| %Planet{x: x, y: y} | |
| else |
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 tk.zorgatone.simpleoctree; | |
| public interface Bounds { | |
| Point getTopRight(); | |
| Point getBottomLeft(); | |
| } |
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
| 70 | |
| 7 | |
| 15 | |
| 67 | |
| 3 |
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
| react-native-clean() { | |
| if [ ! -f "react-native.config.js" ] && [ ! -f "app.json" ]; then | |
| echo >&2 "Probably not a react-native project root folder!" | |
| return 1 | |
| else | |
| echo "Detected react-native project root folder..." | |
| fi | |
| if [ -x "command -v watchman" ]; then | |
| watchman watch-del-all |
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
| def fizzbuzz(n) | |
| 1.upto(n) do |i| | |
| div_by_5 = i % 5 == 0 | |
| div_by_3 = i % 3 == 0 | |
| if div_by_3 && div_by_5 | |
| puts "#{i} Fizzbuzz" | |
| elsif div_by_3 | |
| puts "#{i} Fizz" | |
| elsif div_by_5 | |
| puts "#{i} Buzz" |
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
| def get_title | |
| print 'Enter movie title: ' | |
| title = gets.chomp | |
| if title.length < 1 | |
| print 'Invalid title!' | |
| return nil | |
| else | |
| return title.to_sym | |
| 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
| eyJ3YXJyaW9yTmFtZSI6IlpvcmdhdG9uZSIsInRvd2VyTmFtZSI6ImJlZ2lubmVyIiwiZGlyZWN0b3J5UGF0aCI6Ii4iLCJsZXZlbE51bWJlciI6NSwic2NvcmUiOjE3NiwiY2x1ZSI6ZmFsc2UsImVwaWMiOmZhbHNlLCJlcGljU2NvcmUiOjAsImF2ZXJhZ2VHcmFkZSI6bnVsbCwiY3VycmVudEVwaWNTY29yZSI6MCwiY3VycmVudEVwaWNHcmFkZXMiOnt9fQ== |
NewerOlder