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 { Dimensions, Platform, PixelRatio } from 'react-native' | |
const { width: SCREEN_WIDTH } = Dimensions.get('window') | |
// based on iphone 5s's scale | |
const scale = SCREEN_WIDTH / 320 | |
export function normaliseSize(size) { | |
const newSize = size * scale | |
if (Platform.OS === 'ios') { |
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
const greet = (name = ‘Mark’, surname = ‘Zuckerberg’, sex = ‘male’) => { | |
const title = sex === ‘male’ ? ‘Mr.’ : ‘Ms.’ | |
return `Greetings, ${title} ${name} ${surname}` | |
} | |
greet() // ‘Greetings, Mr. Mark Zuckerberg’ |
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
const greet = (name = ‘Mark’) => `Greetings, ${name}` | |
greet() // ‘Greetings, Mark’ |
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
const greet = name => `Greetings, ${name}` | |
greet('Mark') // 'Greetings, Mark' |
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
Verifying my Blockstack ID is secured with the address 18JPMK9FJ6cvjyciyPnbJ1YPpGuVcy7ukb https://explorer.blockstack.org/address/18JPMK9FJ6cvjyciyPnbJ1YPpGuVcy7ukb |
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
#!/bin/bash | |
echo "Hello, $USER" | |
function gitPrompt { | |
echo -n "Do you want to configure git? [y/n]: " | |
read configure_git | |
if [ "$configure_git" == "y" ] || [ "$configure_git" == "Y" ]; then | |
configure_git=true | |
getGitConfig |
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
git config --global core.excludesfile ~/.gitignore_global && echo "*~\n.idea\n# OS generated files #\n######################\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db" > ~/.gitignore_global |
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
/* | |
Gra w życie została wymyślona w 1970 roku przez Johna Conwaya. | |
Rozpatrujemy wariant, w którym plansza składa się z komórek rozmieszczonych obok siebie na prostokątnej siatce | |
o wymiarach n × m, w której numeracja wierszy i kolumn zaczyna się od 1. Każda komórka może być w jednym z dwóch stanów: | |
żywa ”X” lub martwa ”.”. Przyjmijmy, że komórki z prawej krawędzi siatki sąsiadują z komórkami z lewej krawędzi siatki, | |
a komórki z górnego wiersza sąsiadują z komórkami dolnego wiersza siatki. Każda komórka ma 8 sąsiadów, połączonych z nią | |
bokiem lub wierzchołkiem. | |
Układ komórek podlega ewolucji. W następnym pokoleniu będą żywe tylko te komórki, które w bieżącym pokoleniu spełniają | |
jeden z dwóch warunków: | |
• Komórka jest żywa i ma dwóch lub trzech żywych sąsiadów (inaczej umiera z samotności lub na |
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
#include <iostream> | |
#include <math.h> | |
// 1500 * 60 s koniec | |
// naczynie 5l | |
// czas = 0 start, stężenie 0.8 = 4l substancji X i 1l wody | |
// pod koniec parzystej minuty robot wypuszcza 0.02l z naczynia | |
// pierwsze wypuszczenie = 119 s | |
// co 50 * 60 s robot dopełnia wodą naczynie do fula | |
// pierwsze dopełnienie = 51 * 60 s |
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
#include <string> | |
#include <iostream> | |
bool checkIndex(std::string full, std::string part, int i, int j) { | |
printf("%c", full[i]); | |
if (part.length() <= j + 1) { | |
return true; | |
} | |
if (full.length() <= i + 1) { |
NewerOlder