Skip to content

Instantly share code, notes, and snippets.

View tchayen's full-sized avatar

Tomasz Czajęcki tchayen

View GitHub Profile
#include <cstdio>
#include <cstdlib>
#include "glew.h"
#include "glfw3.h"
typedef short int16;
typedef int int32;
typedef unsigned short uint16;
typedef unsigned int uint32;
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include "gl3w\gl3w.h"
#include "glfw-3.2\glfw3.h"
#include "soil-1.16\SOIL.h"
// not necessary but makes my life much easier when I can just see the number of
// bits and I dont have to write 'unsigned' as a separate word
import java.util.*;
public class Solution {
private static boolean isPrime(int n) {
if (n < 2) return false;
for (int i = 2; i * i <= n; i++)
if (n % i == 0 || n % (n - i) == 0)
return false;
return true;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
public class Solution {
private static boolean shouldUserBeAsked(List<String> dates) {
Collections.reverse(dates);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
document.documentElement.style.overflow = 'hidden'
const vertices = new Float32Array([-1.0, -1.0, 1.0, -1.0, 0.0, 1.0])
const vertex = `
attribute vec2 a_position;
void main() {
gl_Position = vec4(a_position, 0, 1);
}`
document.documentElement.style.overflow = 'hidden'
const vertices = new Float32Array([0.0, 0.0, 0.0, 300.0, 200.0, 300.0])
const vertex = `
attribute vec2 a_position;
uniform mat3 u_matrix;
void main() {
gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);
}`
document.documentElement.style.overflow = 'hidden'
const obj = `
v 0.5 -0.12 -0.26
v 0.5 -0.12 -0.12
v -0.5 -0.12 -0.26
v -0.5 -0.12 -0.26
v 0.5 -0.12 -0.12
v -0.5 -0.12 -0.12
v -0.5 -0.5 -0.12
document.documentElement.style.overflow = 'hidden'
const vertices = new Float32Array([
-1, -1, -1,
1, -1, -1,
-1, -1, 1,
-1, -1, 1,
1, -1, -1,
1, -1, 1,
@tchayen
tchayen / machine.js
Last active January 7, 2020 11:38
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: "authentication",
initial: "signIn",
context: {
name: "",
email: "",
password: "",
errors: {}
},
states: {
import React, { Component, createContext, useState } from "react";
import {
Animated,
TouchableOpacity,
View,
Text,
StyleSheet,
Platform
} from "react-native";
import { borderRadius, colors } from "./consts";