Skip to content

Instantly share code, notes, and snippets.

View ashgti's full-sized avatar

John Harrison ashgti

View GitHub Profile
{ patterns = (
{ name = 'comment.block.perl6';
begin = '^=begin';
end = '^=end';
},
{ name = 'comment.line.number-sign.perl6';
match = '#.*$';
},
{ name = 'string.quoted.single.perl6';
begin = "'";
@ashgti
ashgti / Perl6Grammar.pm.html
Created March 1, 2015 08:27
Perl6 Grammar with syntax applied from the perl.tmbundle
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<title>Perl6Grammar.nqp</title>
<style media="screen">
atom-text-editor,
:host {
background-color: #002b36;
color: #839496;
}
@ashgti
ashgti / syntax-sample
Last active August 29, 2015 14:16
Syntax highlight example
<!DOCTYPE html>
<html>
<head>
<title>syntax-check.pl6</title>
<style media="screen">
#atom-text-editor,
:host {
background-color: #002b36;
color: #839496;
}
@ashgti
ashgti / wtf.cc
Last active December 12, 2015 00:58
Don't do this ever please. If you have to, please comment it.
#include <stdio.h>
struct foo {
struct dummy {
int i;
};
typedef int dummy::*_bool;
foo(int f) : f_(f) {}
int f_;
Index: lib/profile/GCDAProfiling.c
===================================================================
--- lib/profile/GCDAProfiling.c (revision 173961)
+++ lib/profile/GCDAProfiling.c (working copy)
@@ -269,6 +269,9 @@
for (i = 0; i < num_counters; ++i)
fprintf(stderr, "llvmgcda: %llu\n", (unsigned long long)counters[i]);
#endif
+
+ for (i = 0; i < num_counters; ++i)
#include <iostream>
using namespace std;
class a {
public:
struct dummy { int i; double j; };
typedef int dummy::* _bool;
};
typedef int bar;
#include <stdio.h>
struct FOO {
class_loader::class_loader_private::registerPlugin<A,B> &bar;
};
static FOO foo(baz);
int main(void) {
foo2.bar = 3;
a = foo()
a.bar = 123 # default
with a:
a.bar = 13213
a.do_stuff()
with a:
a.bar = 5432
a.do_stuff()
cc1plus: warning: -Wuninitialized is not supported without -O
In file included from /Users/harjohn/Projects/serial/src/serial.cc:4:
/Users/harjohn/Projects/serial/include/serial/serial.h:610: warning: ‘class serial::SerialExecption’ has pointer data members
/Users/harjohn/Projects/serial/include/serial/serial.h:610: warning: but does not override ‘serial::SerialExecption(const serial::SerialExecption&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:610: warning: or ‘operator=(const serial::SerialExecption&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:624: warning: ‘class serial::IOException’ has pointer data members
/Users/harjohn/Projects/serial/include/serial/serial.h:624: warning: but does not override ‘serial::IOException(const serial::IOException&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:624: warning: or ‘operator=(const serial::IOException&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:651: warning: ‘class serial::PortNotOpenedException’ has pointe
@ashgti
ashgti / Output
Created April 4, 2012 17:02
C++ Templates with default params
Type is... int
Type is... char
Type is... float
Type is... double
Type is... long
Type is... short
Type is... int
Type is... double