Skip to content

Instantly share code, notes, and snippets.

View jkomyno's full-sized avatar
🏠
Working from home

Alberto Schiabel jkomyno

🏠
Working from home
View GitHub Profile
const { Response, Headers, Request } = require('whatwg-fetch');
global.Response = Response;
global.Headers = Headers;
global.Request = Request;
global.console = {
log: () => {},
warn: () => {},
};
global.fetch = require('jest-fetch-mock');
@jkomyno
jkomyno / AppText.js
Created June 22, 2017 10:39
React Native's Text wrapper which allows to define easily a global font for the application
import React from 'react';
import PropTypes from 'prop-types';
import {
Text,
StyleSheet,
ViewPropTypes,
} from 'react-native';
const baseStyle = StyleSheet.create({
fontFamily: 'Helvetica', // your font here
#include<iostream>
using namespace std;
struct nodo {
int info;
nodo* next;
nodo(int a=0, nodo* b=0) {
info=a;
next=b;
}
@jkomyno
jkomyno / SearchBar.android.js
Created July 14, 2017 10:33
Platform consistent SearchBar component for react-native
import React from 'react';
import PropTypes from 'prop-types';
import SearchBar from 'react-native-material-design-searchbar';
const SearchBar = ({ onChangeText, onBackButtonPress, placeholder }) => (
<SearchBar
onSearchChange={onChangeText}
placeholder={placeholder}
onBackPress={onBackButtonPress}
height={50}
@jkomyno
jkomyno / getIPWithMask.go
Created July 17, 2017 15:27
Get local IP with short subnet mask notation, example: "192.168.252.129/24"
package main
import (
"fmt"
"net"
"os"
)
func getIPWithMask() string {
addrs, err := net.InterfaceAddrs()
@jkomyno
jkomyno / getFlatList.bash
Created July 25, 2017 10:38 — forked from cooperka/getFlatList.bash
How to download FlatList and its related dependencies directly into your node_modules.
mkdir -p node_modules/react-native/Libraries/Lists/ && \
for file in 'FlatList' 'MetroListView' 'SectionList' 'VirtualizedList' 'VirtualizedSectionList' 'ViewabilityHelper' 'VirtualizeUtils'; \
do curl https://raw.githubusercontent.com/facebook/react-native/master/Libraries/Lists/${file}.js > node_modules/react-native/Libraries/Lists/${file}.js; \
done
#include<iostream>
using namespace std;
struct nodo{int info; nodo* next; nodo(int a =0, nodo* b=0){info=a; next=b;}};
struct doppioN{nodo*inizio,* fine; int lung; doppioN(nodo* a =0, nodo* b=0, int c=0){inizio=a; fine=b;lung=c;}};
nodo* build(int n)
{
if(n>0)
@jkomyno
jkomyno / gist:9962e799693d75d32e47320ca21d0652
Created September 29, 2017 16:42
React Native SwipeableList
https://github.com/facebook/react-native/commit/d8cc6e3c2b8c2dc25b6b32691779790c15de8d10
@jkomyno
jkomyno / virtual-fixed.cpp
Created January 1, 2018 20:55
OOP c++ virtual
#include <vector>
#include <iostream>
class A {
private:
std::vector<int> data_;
public:
A()
{
@jkomyno
jkomyno / Gallo.h
Last active January 29, 2018 12:44
GalloFile, OOP c++
#pragma once
#include <vector>
#include "GalloFile.h"
class Gallo {
private:
std::vector<GalloFile*> files;
public:
Gallo(const std::vector<GalloFile*> v) :