This file contains hidden or 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
export async function convertAudioToOgg(input: stream.Readable, output: string) { | |
return new Promise<void>((res, rej) => { | |
ffmpeg() | |
.input(input) | |
.audioChannels(1) | |
.audioCodec('opus') | |
.toFormat('ogg') | |
.addOutputOptions('-avoid_negative_ts make_zero') | |
.output(output) | |
.on('progress', function (progress) { |
This file contains hidden or 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
/* | |
Include this file inside your HEAD tag and add the attribute | |
`shortcut-key` (or `shortcut-keys`) to any HTML element that accepts .click(). | |
<button shortcut-keys="enter,space">Submit</button> | |
This code use KeyboardEvent.code to map the shortcuts. See more https://developer.mozilla.org/pt-BR/docs/Web/API/KeyboardEvent/code | |
*/ | |
(function (d) { |
This file contains hidden or 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
public static class ExtensionContextClear { | |
public static void Clear(this DbContext context) { | |
var properties = context.GetType().GetProperties(); | |
foreach(var property in properties) { | |
var setType = property.PropertyType; | |
bool isDbSet = setType.IsGenericType && (typeof(DbSet < > ).IsAssignableFrom(setType.GetGenericTypeDefinition())); | |
if (!isDbSet) continue; | |
var dbSet = (dynamic) property.GetValue(context, null); |
This file contains hidden or 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
/* ... */ | |
updateMobile(mobile){ | |
return function (dispatch) { | |
return axios.post('/update-mobile',{mobile}) | |
.then(response=>{ | |
dispatch(success()); | |
}) | |
.catch(e=>{ | |
dispatch(error()) | |
}); |