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
package main | |
import ( | |
"fmt" | |
"os" | |
"flag" | |
"path/filepath" | |
) | |
func usage() { |
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
package main | |
import ( | |
"bufio" | |
"log" | |
"os" | |
"strings" | |
) | |
func main() { |
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
package main | |
import ( | |
"log" | |
"os" | |
"path/filepath" | |
) | |
func main() { | |
searchDir, err := os.Getwd() |
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
package main | |
import "strconv" | |
func interfaceToFloat(value interface{}) float64 { | |
if value == nil { | |
return 0.0 | |
} | |
switch typedValue := value.(type) { | |
case float64: |
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
package main | |
import "os" | |
func fileExists(reqFilePath string) bool { | |
_, err := os.Stat(reqFilePath) | |
exists := false | |
if err == nil { | |
exists = true | |
} else { |
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
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func dlog(format string, args ...interface{}) { | |
fmt.Fprintf(os.Stderr, format, args...) | |
fmt.Fprintf(os.Stderr, "\n") |
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
if [ -f "$file" ]; then | |
echo "$file found." | |
fi | |
if [ ! -f "$file"]; then | |
echo "$file not found." | |
fi |
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
# | |
# Without arguments: | |
# | |
#!/bin/bash -ex | |
main() | |
{ | |
# … | |
} |
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
NSMutableArray *indexPathsToDelete = [NSMutableArray new]; | |
for (Object *object in newObjects) | |
{ | |
if (![currentObjects containsObject:object]) { | |
int row = [newObjects indexOfObject:object]; | |
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:0]; | |
[indexPathsToDelete addObject:indexPath]; | |
} | |
} |
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
# | |
# Place this code to your .profile, .bashrc, .bash_profile or whatever | |
# | |
program_exists () { | |
type "$1" &> /dev/null ; | |
} | |
if program_exists go; then |
NewerOlder