Skip to content

Instantly share code, notes, and snippets.

View IvanUshakov's full-sized avatar

Ivan Ushakov IvanUshakov

View GitHub Profile
struct GridView<S>: View where S: ShapeStyle {
let linesCount: Int
let content: S
private func hLine(geometry: GeometryProxy, index: Int) -> Path {
Path { path in
let yPosition = geometry.size.height / 10 * CGFloat(index)
path.move(to: CGPoint(x: 0, y: yPosition))
path.addLine(to: CGPoint(x: geometry.size.width, y: yPosition))
@IvanUshakov
IvanUshakov / main.c
Created February 21, 2017 05:56
normalize file path
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *normalize(const char *path);
int main(int argc, const char * argv[])
{
puts(normalize("../bar"));
@IvanUshakov
IvanUshakov / gist:4536968
Created January 15, 2013 07:41
Run genstrings for subdirectories too
find ./ -name \*.m -print0 | xargs -0 genstrings -o en.lproj
@IvanUshakov
IvanUshakov / g.pas
Created March 30, 2012 18:33
Первая игра
program pr_game;
uses crt;
label exit,start;
var pos:array [1..5] of integer;
i,w,pobed,stav,time:integer;
k:boolean;
begin
start:
normvideo;
textbackground(15);