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
| function boo() | |
| print "boo" | |
| end | |
| function add(x, y) | |
| return x + y | |
| end |
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
| // | |
| // extracts Access 97 password from an MDB file | |
| // | |
| // Based on information from: https://github.com/brianb/mdbtools/blob/master/HACKING | |
| // | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <memory.h> |
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
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include "rng.h" | |
| void | |
| rng_restore(struct rng_s *rng) { |
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
| namespace PluggableApplication.Common | |
| { | |
| using System; | |
| public interface IPlugin | |
| { | |
| string Name { get; } | |
| string Description { get; } | |
| string Author { get; } |
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 | |
| # make sure that the required package is installed | |
| if [ $(dpkg-query -W -f='${Status}' libimage-exiftool-perl 2>/dev/null | grep -c "ok installed") -eq 0 ]; | |
| then | |
| sudo apt-get install -y libimage-exiftool-perl | |
| fi | |
| # remove all metadata from JPEG files in the current directory | |
| exiftool -all= *.jpg |
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
| public static class MailMessageExtensions | |
| { | |
| /// <summary> | |
| /// Attaches a file to the specified mail message. | |
| /// </summary> | |
| /// <param name="sourceFilename">The filename of the file to attach.</param> | |
| /// <param name="attachmentFilename">The name of the attachment as it will appear in the email.</param> | |
| /// <param name="contentType">The MIME type of the attachment.</param> | |
| public static void AttachFile(this MailMessage message, string sourceFilename, string attachmentFilename, string contentType) | |
| { |
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
| char *trim(char *s) { | |
| size_t length = strlen(s); | |
| while (length > 0) { | |
| if (s[0] == ' ') | |
| memmove(s, s + 1, --length); | |
| else if (s[length - 1] == ' ') | |
| s[--length] = '\0'; | |
| 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
| #include <stdio.h> | |
| #include <time.h> | |
| static char dttm[20]; | |
| const char *get_utc_date() { | |
| time_t now; | |
| struct tm *utcdate; | |
| time(&now); | |
| utcdate = gmtime(&now); |
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
| static char *keyword; | |
| static char *args[10]; // array of pointers to the arguments (stored in command) | |
| int parse_command(char *command, char **keyword, char *args[]) { | |
| char *tmp; | |
| int n; | |
| tmp = strtok(command, " "); | |
| if (tmp != NULL) | |
| *keyword = tmp; |
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
| static class RandomExtensions | |
| { | |
| public static bool NextBoolean(this System.Random rng) | |
| { | |
| // 2 because Next returns values between 0 and max - 1 | |
| return rng.Next(2) > 0; | |
| } | |
| } |