Skip to content

Instantly share code, notes, and snippets.

View kukiron's full-sized avatar
🚀
I do stuff.

Kafil Uddin Kiron kukiron

🚀
I do stuff.
View GitHub Profile
@kukiron
kukiron / AttachmentPicker.ts
Created March 5, 2020 14:56 — forked from Aliath/AttachmentPicker.ts
Wrapper for the react-native-image-picker and react-native-document-picker. Allow to pick media from gallery on iOS.
import { Platform, ActionSheetIOS } from 'react-native';
import DocumentPicker from 'react-native-document-picker';
import ImagePicker from 'react-native-image-picker';
import RNFS from 'react-native-fs';
type Captions = {
image: string,
document: string,
cancel: string,
title: string,
@kukiron
kukiron / dark-script.js
Created February 28, 2020 08:36
GitHub Dark Script
// ==UserScript==
// @name GitHub Dark Script
// @version 2.5.8
// @description GitHub Dark in userscript form, with a settings panel
// @license MIT
// @author StylishThemes
// @namespace https://github.com/StylishThemes
// @include /^https?://((blog|gist|guides|help|raw|status|developer)\.)?github\.com/((?!generated_pages\/preview).)*$/
// @include https://*.githubusercontent.com/*
// @include https://*graphql-explorer.githubapp.com/*
@kukiron
kukiron / FilePickerModule.java
Created January 21, 2020 10:58
Update of `FilePickerModule` from callback to promise implementation in `react-native-file-picker`
package com.filepicker;
import android.Manifest;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ContentUris;
import android.content.Context;
import execute from '../execute';
import type { AcquiredCreation, AcquiredCreationInput } from '../types';
export default async (
acquiredCreationInputs: Array<AcquiredCreationInput>,
): Promise<Array<AcquiredCreation>> => {
const queryParameters = acquiredCreationInputs
.map((_, index) => `$creationId${index}: ID!, $type${index}: String!`).join(', ');
const parameters = acquiredCreationInputs.reduce(
@kukiron
kukiron / mapOrder.js
Created June 14, 2019 04:02
Order an array of objects based on another array order
const mapOrder = (array, order, key) => array
.sort((a, b) => order.indexOf(a[key]) > order.indexOf(b[key]) ? 1 : -1);
/**
* Example:
*/
const item_array = [
{ id: 2, label: 'Two' },
{ id: 3, label: 'Three' },
if test -f /etc/profile.d/git-sdk.sh
then
TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
TITLEPREFIX=$MSYSTEM
fi
if test -f ~/.config/git/git-prompt.sh
then
. ~/.config/git/git-prompt.sh
@kukiron
kukiron / .hyper.js
Last active November 17, 2019 07:24
Latest Hyper setup & VSCode styles
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@kukiron
kukiron / git-prompt_old.sh
Last active February 17, 2019 13:41
Git Bash Prompt for Windows
if test -f /etc/profile.d/git-sdk.sh
then
TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
TITLEPREFIX=$MSYSTEM
fi
if test -f ~/.config/git/git-prompt.sh
then
. ~/.config/git/git-prompt.sh
@kukiron
kukiron / vscode-settings.json
Last active March 24, 2020 14:02
Settings of VSCode with Sublime Material Dark Theme
{
"auto-rename-tag.activationOnLanguage": [
"html",
"xml",
"php",
"javascript",
"javascriptreact"
],
/** BEAUTIFY **/
@kukiron
kukiron / .hyper.js
Created June 25, 2018 04:14
Settings & other plugin customization files for Hyper
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',