This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Redis = require('ioredis'); | |
const lz4 = require('lz4-napi'); | |
const snappy = require('snappy'); | |
async function compress() { | |
const compressedData = await lz4.compress(JSON.stringify(json)); | |
// const compressedData = await snappy.compress(JSON.stringify(sampleData)); | |
await client.set(key, compressedData); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readlinePkg = require('readline'); | |
const fs = require('fs'); | |
async function main() { | |
// read the string filename | |
const filename = readLine(); | |
const rl = readlinePkg.createInterface({ | |
input: fs.createReadStream(filename), | |
crfDelay: Infinity | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "people", | |
"unicode": "1f642", | |
"char": "🙂", | |
"emojis": [ | |
{ | |
"name": "grinning face", | |
"unicode": "1f600", | |
"char": "😀" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.emoji-panel{ | |
background-color: #fff; | |
box-shadow: 0 4px 4px 0 rgba(0,0,0,.06); | |
width: 400px; | |
} | |
.emoji-panel__heading{ | |
background-color: #f0f0f0; | |
display: flex; | |
justify-content: space-between; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import './App.css'; | |
import json from "./emojis.json"; | |
function App() { | |
const [emojiIndex, setEmojiIndex] = useState(0); | |
/** | |
* Create the heading bar | |
*/ | |
function createSvgHeading() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final Pattern DIR_SEPORATOR = Pattern.compile("/"); | |
/** | |
* Returns all available SD-Cards in the system (include emulated) | |
* | |
* Warning: Hack! Based on Android source code of version 4.3 (API 18) | |
* Because there is no standart way to get it. | |
* TODO: Test on future Android versions 4.4+ | |
* | |
* @return paths to all available SD-Cards in the system (include emulated) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
<script language="javascript" src="list.js"></script> | |
</head> | |
<body> | |
<FORM name="drop_list" onsubmit=showAlert(); > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=input("Enter number:\n") | |
l=len(str(r)) | |
list = [] | |
while len(list) == len(set(list)) : | |
x=str(r*r) | |
if l % 2 == 0: | |
x = x.zfill(l*2) | |
else: | |
x = x.zfill(l) | |
y=(len(x)-l)/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final int give_write = 1; | |
// check whether permission is granted or not(in your on create method) | |
if (ContextCompat.checkSelfPermission(this, | |
Manifest.permission.WRITE_EXTERNAL_STORAGE) | |
!= PackageManager.PERMISSION_GRANTED) { | |
// show an explanation why permission is needed if it was denied before | |
if (ActivityCompat.shouldShowRequestPermissionRationale(this, | |
Manifest.permission.WRITE_EXTERNAL_STORAGE)) { |