Skip to content

Instantly share code, notes, and snippets.

View mygnu's full-sized avatar
I would rather be sailing or riding 🏍️

Harry Gill mygnu

I would rather be sailing or riding 🏍️
View GitHub Profile
@mygnu
mygnu / configfr_builder.rs
Last active October 21, 2021 12:22
CONFIGFRS
pub const B0: u32 = 1 << 0;
pub const B1: u32 = 1 << 1;
pub const B2: u32 = 1 << 2;
pub const B3: u32 = 1 << 3;
pub const B4: u32 = 1 << 4;
pub const B5: u32 = 1 << 5;
pub const B6: u32 = 1 << 6;
pub const B7: u32 = 1 << 7;
pub const B8: u32 = 1 << 8;
pub const B9: u32 = 1 << 9;
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@mygnu
mygnu / hash.c
Created April 16, 2014 12:53 — forked from tonious/hash.c
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;
@mygnu
mygnu / sample.xml
Created January 27, 2014 01:27
testxml
<internode><api><service type="Personal_ADSL" request="history">3854328</service><usagelist><usage day="2013-01-26"><traffic name="total" unit="bytes">3038963621</traffic></usage><usage day="2013-01-27"><traffic name="total" unit="bytes">655453443</traffic></usage><usage day="2013-01-28"><traffic name="total" unit="bytes">574066529</traffic></usage><usage day="2013-01-29"><traffic name="total" unit="bytes">773252202</traffic></usage><usage day="2013-01-30"><traffic name="total" unit="bytes">4869566556</traffic></usage><usage day="2013-01-31"><traffic name="total" unit="bytes">1987457829</traffic></usage><usage day="2013-02-01"><traffic name="total" unit="bytes">422007374</traffic></usage><usage day="2013-02-02"><traffic name="total" unit="bytes">724808476</traffic></usage><usage day="2013-02-03"><traffic name="total" unit="bytes">2111501510</traffic></usage><usage day="2013-02-04"><traffic name="total" unit="bytes">1725925308</traffic></usage><usage day="2013-02-05"><traffic name="total" unit="bytes">50825691
@mygnu
mygnu / libxml_parsig.c
Created January 27, 2014 01:22
libxml2 test
/* Code: */
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <stdio.h>
xmlDocPtr
getdoc (char *docname)
{
xmlDocPtr doc;
doc = xmlParseFile(docname);
@mygnu
mygnu / main.c
Created January 25, 2014 01:44
xmlparsig
/* Code: */
#include <stdio.h>
#include <string.h>
#include "internodeAPI.h"
#include "xmlparsing.h"
#define BASEXML "tmp/nodeservice.xml"
/* sample XML file */
/* <internode> */
/* <api> */
/* <services count="1"> */
@mygnu
mygnu / gist:8467443
Last active January 3, 2016 13:09
removing all spaces form a string
int
main(int argc, char *argv[])
{
char mystr[50] = {"The brown fox."};
//gets(mystr);
char result[50];// = "______________";
printf("%s \n", mystr);
removeXtraSpaces(mystr, result);
printf("%s\n", result);