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
File file = new File("./input.txt"); | |
Scanner sc = new Scanner(file); | |
Integer currentElf = 0; | |
ArrayList<Integer> elfCalories = new ArrayList<>(); | |
elfCalories.add(0); | |
while (sc.hasNextInt()) { | |
String line = sc.nextLine(); |
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
{ | |
"keymaps": { | |
"0": { "type": "scroll.home" }, | |
":": { "type": "command.show" }, | |
"o": { "type": "command.show.open", "alter": false }, | |
"O": { "type": "command.show.open", "alter": true }, | |
"t": { "type": "command.show.tabopen", "alter": false }, | |
"T": { "type": "command.show.tabopen", "alter": true }, | |
"w": { "type": "command.show.winopen", "alter": false }, | |
"W": { "type": "command.show.winopen", "alter": true }, |
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 | |
twitch_accounts=() | |
while read line | |
do | |
twitch_accounts+=("$line") | |
done < <(curl http://www.reddit.com/r/RedditDads/wiki/twitch_and_youtube | grep "* http://www.twitch.tv/" | sed 's/* http\:\/\/www\.twitch\.tv\//\ /;s//\n/') | |
for twitch_account in "${twitch_accounts[@]}" | |
do |
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
Matts-MacBook-Air:cleveland-land-services.co.uk mattkirwan$ grunt --env=production | |
Running "replace:modxSettings" (replace) task | |
Replace web/z64ml/config.core.php → web/z64ml/config.core.php | |
Replace web/n3yu9/config.core.php → web/n3yu9/config.core.php | |
Replace web/config.core.php → web/config.core.php | |
Replace core_tY670_uW/config/No3r4kXHBbNdLJdw9ryZJrfrP52Jvy1q.inc.php → core_tY670_uW/config/No3r4kXHBbNdLJdw9ryZJrfrP52Jvy1q.inc.php | |
Running "copy:build" (copy) task | |
Created 17 directories, copied 120 files |
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
Q: Having problems with [usemin, grunt, useminprepare] not correctly renaming hook blocks in a [html, twig] template? | |
A: Check the motherfucking line endings of that file and ensure they are 'Unix'. | |
Q: Running a cron job and the script isn't firing? | |
A: Don't forget to check the PATH variable is imported at the top of the .sh file | |
Q: Having problems updating ModX directories (eg: core) and the /setup/ upgrade not working? | |
A: Make sure you replace the files/directories with the cp -R command and not Finder. Because Finder merge is weird and shit. |
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
<?php | |
/*********************************************** | |
Raw Data: | |
@$raw_data | |
Array | |
( | |
[0] => Array |
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 | |
function install_laravel() { | |
echo "Installing Laravel into '$project_name'..." | |
wget https://github.com/laravel/laravel/archive/master.zip ./ | |
unzip ./master.zip |
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
Starting php-fpm: | |
[06-Jun-2013 18:38:32] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0 | |
[ OK ] |
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 | |
# Update packages | |
yum update | |
# Add some repos | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
# Install MySQL |
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
<?php | |
function convertToSlug($input) | |
{ | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $input); | |
$text = trim($text, '-'); | |
$text = strtolower($text); | |
$text = preg_replace('~[^-\w]+~', '', $text); | |
return $text; | |
} |
NewerOlder