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
/** | |
* I am using this task to make a demonstration about Kotlin sequences. | |
* @author Georgi Naumov | |
* [email protected] for contacts and suggestions. | |
*/ | |
const val INPUT_SIZE = 5 | |
fun readSequence(iteration: Int): Sequence<String> { | |
var count = iteration | |
return generateSequence { |
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
package com.company | |
fun main() { | |
for ((index, shot) in BooleanArray(6) { false }.apply { | |
this[(0 until this.size).random()] = true | |
this.shuffle() | |
}.withIndex()) { | |
if (shot) { | |
println("Iteration ${index + 1}. You are dead ..") | |
break |
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
awk -F "," '{print "INSERT INTO table_name(\"first_field\",\"second_field\") VALUES('\''"$1"'\'','\''"$2"'\'') ON CONFLICT DO NOTHING;"}' CSVFileNAme.csv > V1.22_migration_name.sql |
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
/** | |
* Let's make a program that accepts a matrix and if | |
* the elements below the main diagonal are less than | |
* zero replace them with zero ... | |
*/ | |
fun main() { | |
""" | |
1 2 -1 | |
-1 -1 6 | |
-1 -1 9 |
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
package com.example.uniformcivilnumber | |
import android.content.Intent | |
import android.os.Bundle | |
import android.view.View | |
import androidx.appcompat.app.AppCompatActivity | |
import com.example.uniformcivilnumber.databinding.ActivityResultBinding | |
class ResultActivity : AppCompatActivity() { | |
private lateinit var binding: ActivityResultBinding |
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
/** | |
* Merry Christmas from Kotlin | |
*/ | |
fun main() { | |
println( | |
arrayOf( | |
"M", | |
"rr", | |
"Chr", | |
"stm", |
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
/** | |
* This tiny script extracts data from: | |
* https://occultthings.wordpress.com/2012/09/07/%D0%B3%D0%B0%D0%B4%D0%B0%D0%B5%D0%BD%D0%B5-%D1%81-%D0%BA%D0%B0%D1%80%D1%82%D0%B8-%D0%B7%D0%B0-%D0%B8%D0%B3%D1%80%D0%B0-%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5-%D0%BD%D0%B0-%D0%BA%D0%B0%D1%80/ | |
* created json array and download it. | |
**/ | |
(function() { | |
const cards = document.body.textContent.split("Асо").splice(1) | |
const results = []; | |
cards.forEach((item) => { | |
const toHandle = `Асо${item}`; |
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
#!/usr/bin/env bash | |
for file in *.webm; do ffmpeg -i "$file" -vf scale=240:-2 "${file%.*}.mp4"; done && echo "All done" |
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
#!/bin/sh | |
export MESA_GL_VERSION_OVERRIDE=4.4 | |
chmod -R 0700 game desktop winetools desktop-editor editor desktop-fix start | |
cd "`dirname "$0"`" | |
# Improvement. Now it will detect active output | |
# automatically! :) In the dark, I drink a whole | |
# box of Schweps. How great I am! | |
active_output=$(xrandr | grep [[:blank:]]connected[[:blank:]] | awk '{ print $1 }') |