Skip to content

Instantly share code, notes, and snippets.

View renso3x's full-sized avatar
🎯
Focusing

Renso3x renso3x

🎯
Focusing
View GitHub Profile
@renso3x
renso3x / .deps...remix-tests...remix_accounts.sol
Created January 10, 2023 05:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@renso3x
renso3x / 01: basic types.ts
Created November 21, 2019 03:47 — forked from dimitardanailov/01: basic types.ts
Typescript in action
/**
* Boolean
*
* The most basic datatype is the simple true/false value,
* which JavaScript and TypeScript (as well as other languages) call a 'boolean' value.
*/
var isDone: boolean = false;
/**
* Number
@renso3x
renso3x / csvParser.js
Created October 18, 2019 08:10
excel parser
const XLSX = require('xlsx')
const path = require('path')
const fs = require('fs')
const file = path.join(__dirname, '/rental_units.xlsx')
fs.readFile(file, (err, data) => {
var wb = XLSX.readFile(file)
/* generate array of arrays */
data = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]], { header: 1 })
Object.defineProperty(Array.prototype, "first", {
get: function() {
return this[0];
}
});
Object.defineProperty(Array.prototype, "last", {
get: function() {
return this[this.length - 1];
}
'use strict';
import { v1 as neo4j } from 'neo4j-driver';
import crypto from 'crypto';
import uuidv4 from 'uuid/v4';
import middleware from 'lambda-utilities/lib/middleware';
import { filterWarmUpEvent } from 'lambda-utilities/lib/middleware/filterWarmUpEvent';
import { ErrorUnauthorized } from 'lambda-utilities/lib/error';
import { jsonResponse } from '../utils/util';
import errorResponse from '../utils/errorResponse';
@renso3x
renso3x / lambda.js
Created May 6, 2019 10:41
lambda.js
'use strict';
import middleware from 'lambda-utilities/lib/middleware';
import { filterWarmUpEvent } from 'lambda-utilities/lib/middleware/filterWarmUpEvent';
import { ErrorUnauthorized } from 'lambda-utilities/lib/error';
import {
jsonResponse,
getMidNight,
getBeforeMidNight,
getNextDay,
// images are from the properties..
downloadImages = async ({ images }) => {
const newImage = images.map(image => {
return RNFetchBlob.fetch('GET', image.url)
.then(res => {
return {
title_en: image.title_en,
type: image.type,
image: `data:image/png;base64,${res.base64()}`,
@renso3x
renso3x / RCTTextFieldManager.m
Created November 22, 2017 03:24
add this function showNextButton
RCT_CUSTOM_VIEW_PROPERTY(showNextButton, BOOL, RCTTextField)
{
if (json && ([RCTConvert BOOL:json])) {
UIToolbar* toolbar = [[UIToolbar alloc] init];
[toolbar sizeToFit];
UIBarButtonItem* flex = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil action:nil];
UIBarButtonItem* doneButton = [[UIBarButtonItem alloc]
import React from 'react';
import { Animated } from 'react-native';
import CircularProgress from './CircularProgress';
const AnimatedProgress = Animated.createAnimatedComponent(CircularProgress);
class AnimatedCircularProgress extends React.Component {
constructor() {
super();
this._animatedValue = new Animated.Value(0);
import React,{ Component } from 'react';
import { PanResponder, View, Platform } from 'react-native';
import Svg,{ Path, Circle, G,Text } from 'react-native-svg';
class CircularSlider extends Component {
constructor(props){
super(props);
this.handlePanResponderMove = this.handlePanResponderMove.bind(this);
this.cartesianToPolar = this.cartesianToPolar.bind(this);
this.polarToCartesian = this.polarToCartesian.bind(this);