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 | |
| REMOTE_USER=$1 | |
| REMOTE_HOST=$2 | |
| REMOTE_PATH="/home/$REMOTE_USER" | |
| LOCAL_PATH=$(pwd) | |
| echo "Zipping node_modules..." | |
| zip -r -q ../node_modules.zip node_modules/* |
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 | |
| # Default values | |
| button_count=8 # Total number of buttons | |
| required_presses=-1 # Required number of buttons pressed (-1 means no requirement) | |
| generate=false # Flag to check if we should generate combinations | |
| # Function to display help | |
| show_help() { | |
| echo "Usage: $0 [-b BUTTON_COUNT] [-r REQUIRED_PRESSES] [-g]" |
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
| Set-Variable -Name EventAgeDays -Value 1 | |
| Set-Variable -Name CompArr -Value @("Localhost") | |
| Set-Variable -Name LogNames -Value @("Security", "Application") | |
| Set-Variable -Name EventTypes -Value @("Information", "Error", "Warning", "FailureAudit", "SuccessAudit") | |
| Set-Variable -Name ExportFolder -Value "C:\" | |
| $el_c = @() | |
| $now = [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($(Get-Date), [System.TimeZoneInfo]::Local.Id, 'GMT Standard Time') | |
| $startdate=$now.adddays(-5) | |
| $ExportFile=$ExportFolder + "mx_sugus_poc_" + $now.ToString("yyyy.MM.dd_hh.mm") + ".csv" |
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
| func FibonacciRecursive(n int) int { | |
| if n <= 1 { | |
| return n | |
| } | |
| return FibonacciRecursive(n-1) + FibonacciRecursive(n-2) | |
| } |
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
| func FibonacciBinet(n int) int { | |
| sqrt5 := math.Sqrt(5) | |
| phi := (1 + sqrt5) / 2 | |
| return int(math.Round(math.Pow(phi, float64(n)) / sqrt5)) | |
| } |
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
| psql -U username -W -h hostname -d dbname -f db_dump.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
| var roleHarvester = require('role.harvester'); | |
| var roleUpgrader = require('role.upgrader'); | |
| module.exports.loop = function () { | |
| for(var name in Game.creeps) { | |
| var creep = Game.creeps[name]; | |
| if(creep.memory.role == 'harvester') { | |
| roleHarvester.run(creep); | |
| } |
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
| var roleHarvester = require('role.harvester'); | |
| module.exports.loop = function () { | |
| for(var name in Game.creeps) { | |
| var creep = Game.creeps[name]; | |
| roleHarvester.run(creep); | |
| } | |
| } |
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
| var roleHarvester = { | |
| /** @param {Creep} creep **/ | |
| run: function(creep) { | |
| if(creep.store.getFreeCapacity() > 0) { | |
| var sources = creep.room.find(FIND_SOURCES); | |
| if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) { | |
| creep.moveTo(sources[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
| module.exports.loop = function () { | |
| for(var name in Game.creeps) { | |
| var creep = Game.creeps[name]; | |
| if(creep.store.getFreeCapacity() > 0) { | |
| var sources = creep.room.find(FIND_SOURCES); | |
| if(creep.harvest(sources[0]) == ERR_NOT_IN_RANGE) { | |
| creep.moveTo(sources[0]); | |
| } | |
| } |
NewerOlder