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
// Bn -> Float multiplication works like this: 150e6 * (0.5 * 100) / 100 | |
// Also does some coercions for readability | |
const multiplyBnToFloat = (a: string, b: string) => { | |
return (BigInt(a) * BigInt(Number(b) * 100)) / BigInt(100) | |
} | |
// 75000000 | |
multiplyBnToFloat('150000000', '0.5000000000') |
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
Show hidden characters
{ | |
"React Component": { | |
"prefix": "0rc", | |
"body": [ | |
"import React from 'react';", | |
"", | |
"interface ${TM_FILENAME_BASE}Props {", | |
" name: string;", | |
"}", | |
"", |
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
/** | |
* Standard Time to Military time | |
* | |
* @param {number} t Time to be converted | |
* @param {string} moridiem AM/PM | |
* @return {int} | |
*/ | |
export default function stm (t, m) { | |
t = parseInt(t, 10); |
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'; | |
const GenderInputSelect = (props) => | |
<select {...props}> | |
<option>Select gender</option> | |
<option value="male">Male</option> | |
<option value="female">Female</option> | |
</select> | |
export default GenderInputSelect; |
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 { Pubkey } from '@cosmjs/amino' | |
import { Uint64 } from '@cosmjs/math' | |
import { decodePubkey } from '@cosmjs/proto-signing' | |
import { assert } from '@cosmjs/utils' | |
import { stride } from '@stride/proto' | |
import { BaseAccount, ModuleAccount } from 'cosmjs-types/cosmos/auth/v1beta1/auth' | |
import { | |
BaseVestingAccount, | |
ContinuousVestingAccount, | |
DelayedVestingAccount, |
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'; | |
const DummyLink = ({onClick, children, ...props}) => | |
<a href="#" onClick={evt => { | |
evt.preventDefault(); | |
onClick && onClick(); | |
}} {...props}> | |
{children} | |
</a> |
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
<?php | |
Route::get('{all}', function () { | |
return view('index'); | |
})->where('all', '^((?!api).)*'); |
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
; This configuration file is a sample of the default server settings. | |
; Changes to this file will NOT be reflected on the server. | |
; To change the server settings, modify Pal/Saved/Config/LinuxServer/PalWorldSettings.ini. | |
[/Script/Pal.PalGameWorldSettings] | |
OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=0.500000,ExpRate=3.000000,PalCaptureRate=1.500000,PalSpawnNumRate=1.500000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=0.750000,PlayerAutoHPRegeneRate=2.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=0.750000,PalAutoHPRegeneRate=2.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=0.000000,CollectionDropRate=1.500000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.500000,EnemyDropItemRate=2.000000,DeathPenalty=None, |
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
// Our html would be, | |
// <product-search="productCtrl.filter"></product-table> | |
// <product-table="productCtrl.data"></product-table> | |
// Controller As productCtrl | |
angular | |
.module('app') | |
.controller('ProductController', ProductController); | |
function ProductController($scope, $http) { |
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 { format } from 'date-fns' | |
/** | |
* Gives you a mysql standard formatted datetime | |
* e.g., 2018-08-08 23:00:00 | |
*/ | |
function getStandardFormattedDateTime(date: Date = new Date()) { | |
return format(date, 'YYYY-MM-DD HH-mm-ss') | |
} |
NewerOlder