Skip to content

Instantly share code, notes, and snippets.

View Makazone's full-sized avatar

Makar Makazone

  • Silicon Valley Insight
  • Moscow
View GitHub Profile
import React from "react";
class ListComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
lastClickedButton: ""
};
}
import React, { Component } from 'react'
import {
StyleSheet,
View,
Text,
Image,
FlatList,
Button,
TouchableHighlight,
ActivityIndicator
@Makazone
Makazone / check_if_webp_supported.js
Created January 16, 2018 09:06
This snippet checks if browser supports web
function supportsWebP () {
const canvas = typeof document === 'object'
? document.createElement('canvas')
: {}
canvas.width = canvas.height = 1
return canvas.toDataURL
? canvas.toDataURL('image/webp').indexOf('image/webp') === 5
: false
@Makazone
Makazone / gist:2f1764fb1b230a2bbbfcc08ea3b88ba1
Last active October 12, 2017 15:44
Create a boxed shadow around an image
_maybeRenderImage = (imageUri) => {
return (
<View
style={{
marginTop: 30,
width: 250,
borderRadius: 3,
elevation: 2,
shadowColor: 'rgba(0,0,0,1)',
shadowOpacity: 0.2,

Keybase proof

I hereby claim:

  • I am Makazone on github.
  • I am makarst (https://keybase.io/makarst) on keybase.
  • I have a public key whose fingerprint is C86E F424 D8AD 5DCD EE3D 9F71 9D09 F341 9BE3 7A93

To claim this, I am signing this object:

function [y] = Fred_II_Rect(K,f,a,b,h)
x = a:h:b;
n = size(x,2);
wt = 1/2;
wj = 1;
A = zeros(n);
for i = 1:n
A(i,1)= h*wt*K(x(i),x(1));
@Makazone
Makazone / protocols.swift
Created January 27, 2016 20:39
Protocol inheritance in Swift
//: Playground - noun: a place where people can play
import UIKit
protocol A { }
protocol B: A { }
class MyClass: B { }
let b: [B] = (1...3).map { MyClass(indx: $0) }
@Makazone
Makazone / data.json
Created December 1, 2015 12:29
Backend for test iOS project
{
"events": [
{
"title": " LA FORZA DEL DESTINO - VERDI",
"type": "opera",
"dates": ["2015-12-21", "2016-01-21"],
"tickets_left": 123,
"overview": "La forza del destino (The Power of Fate, often translated The Force of Destiny) is an Italian opera by Giuseppe Verdi. The libretto was written by Francesco Maria Piave based on a Spanish drama, Don Alvaro o la fuerza del sino (1835), by Angel de Saavedra, 3rd Duke of Rivas, with a scene adapted from Friedrich Schiller's Wallensteins Lager. It was first performed in the Bolshoi Kamenny Theatre of Saint Petersburg, Russia, on 22 November 1862. \n After some further revisions, performances in Rome in 1863 (as Don Alvaro) and Madrid (with the Duke of Rivas, the play's author, in attendance) followed shortly afterwards, and the opera subsequently travelled to New York and Vienna (1865), Buenos Aires (1866) and London (1867). Verdi made other revisions, with additions by Antonio Ghislanzoni. This version, which premiered at La Scala,
@Makazone
Makazone / pollard_base.cpp
Created November 29, 2015 18:10
p-1 Pollard Factorization algorithm
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
using namespace std;
typedef unsigned long long ull;
@Makazone
Makazone / matan2.m
Last active November 17, 2015 08:50
figure
hold on
% Построим область
for x = -2:0.1:2
for y = -2:0.1:2
z = x + 1i*y;
if (abs(z-(17-8*1i)/13) > 17/11)
plot(x, y, '*r')
newZ = z2(z);