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
#!/usr/local/bin/python3 | |
class Animal(): | |
def __init__(self,name,species,sound,age): | |
self.name = name | |
self.species = species | |
self.sound = sound | |
self.age = age | |
def make_sound(self): |
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
#!/usr/bin/env node | |
const child_process = require('child_process'); | |
function runCmd(cmd) { | |
let resp = child_process.execSync(cmd); | |
let result = resp.toString('UTF8'); | |
return result; | |
} | |
cmd = `curl -w ' | |
time_namelookup: %{time_namelookup} |
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
Solution for https://www.codewars.com/kata/highest-scoring-word/train/javascript | |
const high = (wordsString) => { | |
const words = wordsString.split(" ") | |
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
let scores = [] | |
let maxScore = 0 | |
let maxScoreIndex | |
words.forEach(word => { | |
let letters = word.split('') |
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
>>> d = {} | |
>>> chars | |
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] | |
>>> nums | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26] | |
>>> tups = zip(chars,nums) | |
>>> for i in tups: | |
... d[i[0]] = i[1] | |
... | |
>>> s = 0 |
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
ProBoxAlpha:~ hegemon$ tail .bash_functions | |
hide_dt_icons () | |
{ | |
defaults write com.apple.finder CreateDesktop false && killall Finder | |
} | |
restore_dt_icons () | |
{ | |
defaults write com.apple.finder CreateDesktop true && killall Finder | |
} |
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 | |
###################################################### | |
# Program: netCap.sh | |
# Date Created: 7 July 010 | |
# Description: Starts a TCP dump of the management network and the USRM's or the management network and the proxy. | |
# Date Updated: 1 June 01 | |
# |_Complete Rewrite | |
# |_Added check if running on primary machine | |
# |_Added crateion of pid files for use in cleanup | |
# |_Added ability to be run from cron for simple hourly zips |
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 | |
###################################################### | |
# Program: logGen.sh | |
# Date Created: 22 Aug 2012 | |
# Description: parses the manager log in real time into daily error files | |
# Date Updated: 27 Nov 2013 | |
# |_moved all data parsing logic to awk instead of shell | |
# |_Need to analyze memory/CPU usage and consider changing | |
# |_restart frequency in cron | |
# Developer: Darrell DeCosta (Senior Support Engineer) |
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
AirBoxOmega:Projects d$ python crispy.py | |
What is the Diver's name? Darrell | |
What is the Diver's city? W.Village | |
What is the Diver's difficulty? 3 | |
What is Judge 1's score?? 10 | |
What is Judge 2's score?? 1 | |
What is Judge 3's score?? 4 | |
What is Judge 4's score?? 5 | |
What is Judge 5's score?? 6 | |
[4, 5, 6] |
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
c82a1446be6c:~ decostad$ echo "1,2,3"|awk -F, '{{split($0,arr,",")};if ("1" in arr){print "found it"}}' | |
found it | |
c82a1446be6c:~ decostad$ echo "1,2,3"|awk -F, '{{split($0,arr,",")};if ("2" in arr){print "found it"}}' | |
found it | |
c82a1446be6c:~ decostad$ echo "1,2,3"|awk -F, '{{split($0,arr,",")};if ("3" in arr){print "found it"}}' | |
found it | |
c82a1446be6c:~ decostad$ echo "1,2,3"|awk -F, '{{split($0,arr,",")};if ("4" in arr){print "found it"}}' | |
c82a1446be6c:~ decostad$ echo "1,2,3"|gawk --profile -F, '{{split($0,arr,",")};if ("4" in arr){print "found it"}}' | |
c82a1446be6c:~ decostad$ cat awkprof.out |
NewerOlder