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
defmodule Solution do | |
#Enter your code here. Read input from STDIN. Print output to STDOUT | |
end | |
array_length = IO.read(:stdio, :line) | |
array = IO.read(:stdio, :line) | |
array_length | |
|> String.trim | |
|> String.to_integer |
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
def get_count(self, request, *args, **kwargs): | |
recons_0 = ReconStatus.objects.filter(ageing_days__range=[0,30], deleted=False).count() | |
recons_30 = ReconStatus.objects.filter(ageing_days__range=[30,60], deleted=False).count() | |
recons_60 = ReconStatus.objects.filter(ageing_days__range=[60,90], deleted=False).count() | |
recons_90 = ReconStatus.objects.filter(ageing_days__gte = 90, deleted=False).count() | |
return Response({'recons_0': recons_0, 'recons_30': recons_30, 'recons_60': recons_60, 'recons_90': recons_90}) |
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
# Configures Elixir's Logger to log to file | |
# ensure https://github.com/onkel-dirtus/logger_file_backend | |
# is installed in deps of the project in mix.exs | |
# reuses the original phoenix logging format. | |
config :logger, backends: [{LoggerFileBackend, :request_log}], | |
format: "$time $metadata[$level] $message\n", | |
metadata: [:request_id] | |
# Keep a seperate log file for each env. | |
# logs are stored in the root directory of the application |
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
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\Response; | |
class CORS | |
{ | |
/** |
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
function addLetters() { | |
var alphabet = "abcdefghijklmnopqrstuvwxyz".split(''); | |
var sum = 0; | |
if(arguments.length === 0){ | |
console.log(alphabet[26-1]); | |
return alphabet[26-1]; | |
} | |
for (var i = 0; i < arguments.length; ++i){ | |
let l = arguments[i].toLowerCase(); | |
let t = alphabet.indexOf(l) + 1; |
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
You can now reboot your computer. | |
Please do not forget to make your BIOS boot on sda2/EFI/ubuntu/shimx64.efi file! | |
If your computer reboots directly into Windows, try to change the boot order in your BIOS. | |
If your BIOS does not allow to change the boot order, change the default boot entry of the Windows bootloader. | |
For example you can boot into Windows, then type the following command in an admin command prompt: | |
bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi |
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
ipLookUp() { | |
axios.get('http://ip-api.com/json',{},{headers: { | |
'Access-Control-Allow-Origin': '*', | |
'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, OPTIONS', | |
'Content-Type': 'application/json', | |
}}) | |
.then(response => { | |
console.log('User\'s Location Data is ', response); | |
console.log('User\'s Country', response.data.country); | |
this.getAddress(response.data.lat, response.data.lon) |
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
import Vue from 'vue' | |
import BootstrapVue from 'bootstrap-vue' | |
Vue.use(BootstrapVue) | |
export function toaster(msg = 'Message', title='Success',position='b-toaster-top-right', append = false){ | |
return this.$bvToast.toast( msg, { | |
title: title, | |
toaster: position, | |
variant: 'success', | |
solid: true, | |
appendToast: append |
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
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
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
{"version":1,"resource":"file:///Users/manuelgeek/React/TheRoom/theroom-monorepo/apps/api/src/test/employer-service/opportunity-payment/__mocks__/stripe.ts","entries":[{"id":"olQy.ts","source":"renamed.source","timestamp":1658214641155},{"id":"QHt3.ts","timestamp":1658214718170}]} |