Skip to content

Instantly share code, notes, and snippets.

View Hesowcharov's full-sized avatar

Dmitry Ovcharov Hesowcharov

  • Russia, Krasnodar
View GitHub Profile
import React from 'react';
import Interactable, { IDragEvent, INativeDragEvent } from 'react-native-interactable';
import { StyleSheet, TouchableOpacity, View, FlatList, GestureResponderEvent } from 'react-native';
export type InteractableListItemRefType = React.Component<Interactable.IInteractableView, {}, any> | null | undefined;
export interface ICommonProps {
onPress?: (event: GestureResponderEvent) => void | null,
rightButtons: Array<React.ReactElement<any>>,
leftButtons: Array<React.ReactElement<any>>,
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active May 14, 2024 05:41
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
@JohnL4
JohnL4 / tide-config.el
Last active September 26, 2017 11:41
emacs tide (typescript-mode) configuration
(add-hook 'typescript-mode-hook
(lambda ()
(tide-setup)
(flycheck-mode +1)
(eldoc-mode +1)
(company-mode)
(setq fill-column 120)
(local-set-key "\C-j" 'newline)
(local-set-key "\r" 'newline-and-indent) ;Auto-indent.
(local-set-key "\M-o" 'one-line-section-break)
@viperwarp
viperwarp / ReactNativeJson.java
Created February 24, 2016 03:02
React-Native Module, ReadableMap/Array to Java JSON objects
private static WritableMap convertJsonToMap(JSONObject jsonObject) throws JSONException {
WritableMap map = new WritableNativeMap();
Iterator<String> iterator = jsonObject.keys();
while (iterator.hasNext()) {
String key = iterator.next();
Object value = jsonObject.get(key);
if (value instanceof JSONObject) {
map.putMap(key, convertJsonToMap((JSONObject) value));
} else if (value instanceof JSONArray) {
@qsun
qsun / gist:1247402
Created September 28, 2011 08:49
ruby integer to/from ip address
require 'ipaddr'
IPAddr.new('1.2.3.4').to_i
IPAddr.new(16909060, Socket::AF_INET).to_s