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
#!/bin/sh | |
# A shell script to resize icon images and generate the alternative drawables with the proper screen pixel densities (dip) for Android. | |
# The passed icon image would be the xxxhdpi drawable & the other drawables (xxhdpi, xhdpi, hdpi & mdpi) would be scaled down from that. | |
# How to use: | |
# ./drawablegen.sh <icon image file relative path> | |
# Example: | |
# ./drawablegen.sh my_image.png | |
# This will create all the drawable folders, if not has already, in a res folder inside the current directory (as returned by pwd). | |
# Use only with PNG images. | |
# Requires ImageMagick to be installed & added to the path environment variable. Install with: sudo apt install imagemagick |
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
// Copy the code below and replace in [project_name]\node_modules\metro-config\src\defaults\blacklist.js | |
// Solution by https://github.com/tusharojha | |
// Note you'd have to do this for every project | |
var sharedBlacklist = [ | |
/node_modules[\/\\]react[\/\\]dist[\/\\].*/, | |
/website\/node_modules\/.*/, | |
/heapCapture\/bundle.js /, | |
/.*\/__tests__\/.*/ | |
] |
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
if [ $# -eq 0 ]; then | |
echo "No arguments supplied" | |
else if [ -f "$1" ]; then | |
echo " Creating different dimensions (dips) of "$1" ..." | |
mkdir -p drawable-xxxhdpi | |
mkdir -p drawable-xxhdpi | |
mkdir -p drawable-xhdpi | |
mkdir -p drawable-hdpi | |
mkdir -p drawable-mdpi | |
mkdir -p drawable-ldpi |
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 from 'react'; | |
import useFriendStatus from './useFriendStatus'; | |
export default function FriendListItem(props) { | |
const isOnline = useFriendStatus(props.friend.id); | |
return ( | |
<li style={{ color: isOnline ? 'green' : 'black' }}> | |
{props.friend.name} | |
</li> |
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 admin = require('firebase-admin'); | |
const fs = require('fs'); | |
const serviceAccount = require('../../../../../../Private/myschool-data_transfer-key.json'); | |
admin.initializeApp({ credential: admin.credential.cert(serviceAccount) }); | |
const schema = require('./schema').schema; | |
const firestore2json = (db, schema, current) => { |
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
pragma solidity ^0.4.10; | |
import './SafeMath.sol'; | |
interface ERC20 { | |
function balanceOf(address who) public view returns (uint256); | |
function transfer(address to, uint256 value) public returns (bool); | |
function allowance(address owner, address spender) public view returns (uint256); | |
function transferFrom(address from, address to, uint256 value) public returns (bool); | |
function approve(address spender, uint256 value) public returns (bool); | |
event Transfer(address indexed from, address indexed to, uint256 value); |
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
0% - 00 | |
1% - 03 | |
2% - 05 | |
3% - 08 | |
4% - 0A | |
5% - 0D | |
6% - 0F | |
7% - 12 | |
8% - 14 | |
9% - 17 |
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 android.databinding.DataBindingUtil; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.app.wanna.android.R; | |
import com.app.wanna.android.data.User; | |
import com.app.wanna.android.databinding.LayoutItemPeopleBinding; | |
import com.app.wanna.android.utils.firebaseadapter.FirebaseRecyclerAdapter; |
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
#!/bin/bash | |
EMULATOR=~/Library/Android/sdk/tools/emulator | |
if [ $# -ne 1 ]; then | |
echo "ERROR: Please specify the target AVD from the list below" 1>&2 | |
$EMULATOR -list-avds 1>&2 | |
exit 1 | |
fi | |
$EMULATOR -avd $1 -dns-server "8.8.8.8,8.8.4.4" |
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
if [ $# -eq 0 ]; then | |
echo "No arguments supplied" | |
else if [ -f "$1" ]; then | |
echo " Creating different dimensions (dips) of "$1" ..." | |
mkdir -p drawable-xxhdpi | |
mkdir -p drawable-xhdpi | |
mkdir -p drawable-hdpi | |
mkdir -p drawable-mdpi | |
if [ $1 = "ic_launcher.png" ]; then |
NewerOlder