Skip to content

Instantly share code, notes, and snippets.

View Humberd's full-sized avatar

Maciej Sawicki Humberd

  • Warsaw, Poland
View GitHub Profile
@Humberd
Humberd / lista-v2.txt
Last active March 10, 2023 23:36
Kiepscy
SEZON 1
1. Umarł odbiornik, niech żyje odbiornik!
http://ipla-e1-78.pluscdn.pl/p/movies/8f/8fc6aa7d3808f476dee9b99722343b30.mp4
2. Wiara czyni cuda
http://ipla-e2-21.pluscdn.pl/p/movies/b1/b1272b01cd09906e7fbbd55e44f01b84.mp4
3. Kiepscy – zboczeńcy
http://ipla-e1-79.pluscdn.pl/p/movies/ed/ed98b6aef9b52a15baf1d5c0063bd2da.mp4
@Humberd
Humberd / auto-power-spin.js
Last active July 30, 2022 08:57
Automatically spins the power spin.
/**
1. Open power spin
2. Open the developer console
* Chrome: Ctrl + Shift + J
* Firefox: Ctrl + Shift + K
3. Paste the script below.
* (optionally) replace the MAX_COST value to which it should spin
4. ??
5. Profit
*/
@Humberd
Humberd / index.js
Created July 5, 2020 17:30
poprawione task 2
function areTransationsTheSame (t1, t2) {
return t1.sourceAccount === t2.sourceAccount
&& t1.targetAccount === t2.targetAccount
// ... and the rest
}
export const findDuplicateTransactions = (transactions = []) => {
const groupedTransactionsMap = transactions
.map((transaction) => {
let key = {
version: '3.1'
services:
db:
image: bitnami/postgresql:12.2.0
restart: always
environment:
POSTGRESQL_USERNAME: admin
POSTGRESQL_PASSWORD: admin123
POSTGRESQL_DATABASE: admin
@Humberd
Humberd / love-watcher
Last active February 15, 2019 19:58
Paste this script directly in the URL of your erepublik tab and you will be redirected to one of the active love boosted AIR battles. If it finds nothing it will retry by itself in 10 seconds.
javascript:async function loop() { async function getBattles() { const response = await fetch( 'https://www.erepublik.com/en/military/campaigns-new/'); const data = await response.json(); const battleIds = Object.keys(data.battles); const airBattleIds = battleIds.filter( it => data.battles[it].type === 'aircraft', ); return airBattleIds; } async function hasLoveBoost(battleId) { const response = await fetch( `https://www.erepublik.com/en/military/nbp-stats/${battleId}/4`); const data = await response.json(); return data.battleEffects.valentinesDay.is_active; } function printLinks(battleId) { return `https://www.erepublik.com/en/military/battlefield/${battleId}`; } console.log('Loop triggered'); const battles = await getBattles(); const results = await Promise.all(battles.map(hasLoveBoost)); const boostedBattles = results.map((val, index) => { if (val) { return battles[index]; } return val; }) .filter(it => it) .map(printLinks); if (boostedBattles.length > 0) { location.replace(boostedBattles[0]); } console.lo
fun main(args: Array<String>) {
val firstSection:Double = 1.0;
val lastSection:Double = 2.0;
val epsilon:Double = 0.00000001;
val b = Bisekcja(firstSection,lastSection,epsilon).also { }
println("Miejsce zerowe funkcji: " + b.zero() + ". Liczba iteracji: " + b.zero())
}
////////////////////////////////// task1
db.Film.createIndex({address: "text"})
/////////////////////////////////// task2
db.zadanieMongo.find(
{
age: {$lt: 20},
$text: { $search: "California Texas Pennsylvania" }
},
{
struct BoardColumn {
int iteration;
bool* column;
int columnIndex;
int leftColumnProcRank;
int rightColumnProcRank;
};
std::vector<BoardColumn> bcs; // BoardColumnS
@Humberd
Humberd / scratch_2.ts
Created January 22, 2018 16:51
removeuser
export const removeUserFromRankingOnZgloszenieDelete = functions.database.ref('/users/{userId}/zgloszenia/{zgloszenieId}')
.onDelete(event2 => {
const {userId, zgloszenieId} = event2.params;
const {kodKierunku} = event2.data;
return evet2.data.adminRef.root.child(`/ranking/${kodKierunku}/zgloszenia/${zgloszenieId}`).remove()
});
@Humberd
Humberd / scratch.ts
Created January 21, 2018 19:08
foobar
export const calculateParticipantsNumberOnParticipantCreate = functions.database.ref("/users/{userId}/zgloszenia/{zgloszenieId}")
.onCreate(event2 => {
const {userId, zgloszenieId} = event2.params;
return event2.data.adminRef.root.child(`/users/${userId}/wyniki`).once('value')
.then(eventSnapshot => {
const {rokMatury, przedmioty} = eventSnapshot.val();
return event2.data.adminRef.root.child(`/users/${userId}/zgloszenia/${zgloszenieId}`).update({
liczbaPunktow: 12345