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
| du -h --max-depth=1 ./ | sort -h -r |
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
| const ALPHABET = "abcdefghijklmnopqrstuvwxyz"; | |
| const N = 9; | |
| const LIST = new Array(N).fill(undefined); | |
| const RESPONSES = [6,4,0,4,0,0,2,1,0]; | |
| for (let i = 0; i < N; i++) { | |
| let cur_index = -1; | |
| let free_place_index = 0; |
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
| const START = 1; | |
| const LENGTH = 990; | |
| const ONE_COUNTS = 261; | |
| let cur_length = 0; | |
| let cur_number = 0; | |
| let one_occurences = 0; | |
| // while (cur_length < LENGTH) { | |
| while (one_occurences < ONE_COUNTS) { |
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
| const ways = { | |
| // number: 10 => steps: [A, B, C, A, B, C] | |
| }; | |
| const START = 3; | |
| const FINISH = 22; | |
| let minWayToFinish = undefined; | |
| function check(number, steps = []) { |
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 { throttle } from "lodash"; | |
| export default class Slider { | |
| /** @type { HTMLElement } */ | |
| #parentNode; | |
| /** @type { HTMLElement } */ | |
| #trackNode; | |
| /** @type { HTMLElement[] } */ |
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 | |
| $begin = new Datetime(); | |
| $begin->modify('first day of this month'); | |
| $begin->setTime(0,0,0); | |
| $end = new Datetime(); | |
| $end->modify('last day of this month'); | |
| $end->setTime(23,59,59); | |
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 | |
| function getFirstWeekDayDatetime($datetime) { | |
| return $datetime->modify('+ 1 day')->modify('last monday'); | |
| } | |
| function getLastWeekDayDatetime($datetime) { | |
| return $datetime->modify('- 1 day')->modify('next sunday'); | |
| } |
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/bash | |
| rm -f "/backups/sitename-`date -d "-5 days" --iso`.tar.gz" | |
| mysqldump -u username -ppassword www>db.sql | |
| tar -cvzf "/backups/sitename-`date --iso`.tar.gz" db.sql /var/www/sitefolder --exclude "/var/www/sitefolder/exclude_files" |
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
| #In IDEA, go to Tools > Create Desktop Entry to create a launcher in /usr/share/applications. | |
| cp /usr/share/applications/jetbrains-idea.desktop ~/.local/share/applications/ | |
| #http://nufailm.blogspot.be/2012/05/custom-launcher-for-intellij-idea-in.html | |
| #http://stackoverflow.com/questions/14424254/intellij-launcher-doesnt-work-on-unity |
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 | |
| # default owner user | |
| OWNER="www-data:www-data" | |
| # changed file permission | |
| PERMISSION="664" | |
| # web repository directory | |
| REPO_DIR="/var/www/sitename" |