Skip to content

Instantly share code, notes, and snippets.

View gjorgiev's full-sized avatar
🌍

Georgi Georgiev gjorgiev

🌍
View GitHub Profile
@gjorgiev
gjorgiev / ImagePicker.java
Created March 10, 2016 12:08 — forked from Mariovc/ ImagePicker.java
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
@gjorgiev
gjorgiev / interpreter.rkt
Created January 14, 2017 01:42 — forked from naxhh/interpreter.rkt
MUPL interpreter in racket
#lang racket
(provide (all-defined-out)) ;; so we can put tests in a second file
;; definition of structures for MUPL programs
(struct var (string) #:transparent) ;; a variable, e.g., (var "foo")
(struct int (num) #:transparent) ;; a constant number, e.g., (int 17)
(struct add (e1 e2) #:transparent) ;; add two expressions
(struct ifgreater (e1 e2 e3 e4) #:transparent) ;; if e1 > e2 then e3 else e4
(struct fun (nameopt formal body) #:transparent) ;; a recursive(?) 1-argument function
(struct call (funexp actual) #:transparent) ;; function call
@gjorgiev
gjorgiev / Button.css
Last active January 26, 2021 21:36
Button component
.Button {
background: #cad2c5;
display: flex;
border: 1px solid rgba(0,0,0,0.05);
box-sizing: border-box;
align-items: center;
justify-content: center;
width: 25%;
font-size: 24px;
color: rgba(0, 0, 0, 0.5);
@gjorgiev
gjorgiev / Display.css
Created January 26, 2021 21:39
Display Component
.Display {
display: flex;
justify-content: flex-end;
align-items: center;
background: #2b293d;
height: 20%;
color: #80c9c9;
font-size: 24px;
}
@gjorgiev
gjorgiev / Keypad.css
Created January 26, 2021 21:47
Keypad Component
.Keypad {
display: flex;
flex-wrap: wrap;
flex-direction: column;
height: 80%;
}
@gjorgiev
gjorgiev / Calculator.css
Created January 26, 2021 21:51
Calculator Component
body {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.Calculator {
width: 400px;
height: 300px;
@gjorgiev
gjorgiev / Calculator.js
Created January 26, 2021 22:04
Calculator Component
import React, {Component} from 'react';
import Button from './Button';
import './Calculator.css';
import Display from './Display';
import Keypad from './Keypad';
class Calculator extends Component {
constructor() {
super();
this.state = { data: ''}