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
#!/usr/bin/perl -w | |
use warnings; | |
use strict; | |
use Term::ReadKey; | |
my $tce_mirror = "http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/"; | |
my $tce_dir = `cat /opt/.tce_dir`; | |
$tce_dir = "./tce" if ($tce_dir eq ""); | |
chomp $tce_dir; |
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
#!/usr/bin/perl -w | |
use strict; | |
use Getopt::Std; | |
########The script defaults######### | |
my $make_outfile = "PerlMakefile"; | |
my $exe_outfile = "p.out"; | |
my $compiler = "gcc"; | |
my $src_dir = "./src"; | |
my $obj_dir = "./obj"; |
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
#ifndef ARRAY_H | |
#define ARRAY_H | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
#define ARRAY_EXPAND_SIZE 10 | |
struct array { |
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 <string.h> | |
#include <stdlib.h> | |
#include "array.h" | |
typedef struct array array; | |
typedef struct map map; | |
/** @brief Allocates and initializes a new array */ | |
array *array_new(void) { | |
array *tmp = malloc(sizeof(array)); |
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 <stdlib.h> | |
#include "string_sj.h" | |
int main(int argc, char** argv) { | |
char **items = NULL; | |
const char *s = "Hello, I'm splitting on the space delimiter!"; | |
const char *delim = " "; | |
char *tmp; | |
int i; |
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
#ifndef SPLIT_JOIN_H | |
#define SPLIT_JOIN_H | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
int str_split(const char *src, const char* delim, char*** dest); | |
char *str_join(char** items, int num_items, const char* delim); |
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 <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include "string_sj.h" | |
int str_split(const char* src, const char* delims, char*** dest) { | |
char *s = strdup(src); | |
char *c, *saveptr, *tmp; | |
void *_tmp; | |
int num_tokens = 0, num_size = 10; |
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 handle_319(source, argms) | |
local user = "" | |
local reading_channels = false | |
for argm in argms:gmatch("%a+") do | |
if argm:match("^%:.+$") then | |
reading_channels = true | |
argm = argm:sub(2) | |
end | |
------------------------------------------------------------- | |
if reading_channels then |
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
void PluginManager::fire(string event, int numargs, ...) { | |
lua_getglobal(L, "plugins"); | |
int table_index = lua_gettop(L); | |
if(!lua_istable(L, table_index)) { | |
lua_pop(L, 1); | |
lua_newtable(L); | |
lua_setglobal(L, "plugins"); | |
return; | |
} | |
lua_pushnil(L); |
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
string[3] user; | |
// this end up in the sequence [0] = nick, [1] = ident, [2] = host | |
user[0] = split(trim(words[0], ":"), "!")[0]; | |
if (words[0].find("!") != string::npos && words[0].find("@") != string::npos) { | |
user[1] = split(split(trim(words[0], ":"), "!")[1], "@")[0]; | |
user[2] = split(split(trim(words[0], ":"), "!")[1], "@")[1]; | |
} else { | |
user[1] = ""; | |
user[2] = ""; | |
} |
NewerOlder