Skip to content

Instantly share code, notes, and snippets.

View autarch's full-sized avatar

Dave Rolsky autarch

View GitHub Profile
Volunteer with CAA and make a difference for animals! We have a wide range of volunteer opportunities available. Whether you're a student, professional, parent, or retiree, you can help animals.
[ev_blockquote author="Margot, CAA Volunteer"]As a vegetarian arriving at the University of Minnesota campus, I wanted to find a group of people who cared for animals as much as I did. Compasionate Action for Animals was so accepting and it was wonderful being involved in this group. I felt like I actually made a difference when I tabled, talking to the numerous students and teachers passing by.[/ev_blockquote]
Our volunteer opportunities are categorized by time commitment and type of work.
<h3>Time Commitment</h3>
<ul>[pods name="volunteer_opportunity_tag" where="tt.parent = 58" orderby="name ASC" template="volunteer-opportunity-tag-list-item"][/pods]</ul>
<h3>Type of Work</h3>
<ul>[pods name="volunteer_opportunity_tag" where="tt.parent = 61" orderby="name ASC" template="volunteer-opportunity-tag-list-item"][/pods]
SomeStruct *foo = calloc(1, sizeof(SomeStruct));
SomeStruct_open(filename, foo);
// frees foo
SomeStruct_close(foo);
/*-----------------------------------------------*/
SomeStruct *foo;
SomeStruct_open(filename, &foo);
// frees foo
{
package Foo;
use Moose;
has foo => (
traits => ['Array'],
default => sub { [] },
handles => { swozzle => 'swozzle' },
);
CREATE TABLE "Domain" (
domain_id integer NOT NULL,
web_hostname hostname NOT NULL,
email_hostname hostname NOT NULL,
requires_ssl boolean DEFAULT false,
creation_datetime timestamp without time zone DEFAULT now() NOT NULL,
CONSTRAINT valid_email_hostname CHECK (((email_hostname)::citext <> ''::citext)),
CONSTRAINT valid_web_hostname CHECK (((web_hostname)::citext <> ''::citext))
);
COPY "Domain" (domain_id, web_hostname, email_hostname, requires_ssl, creation_datetime) FROM stdin;
1 silkiwiki.org silkiwiki.org f 2010-07-19 22:09:02.33503
2 wiki.exploreveg.org wiki.exploreveg.org f 2010-07-23 05:07:50.868668
3 minneapolis.pm.org minneapolis.pm.org f 2010-09-12 20:57:34.703314
4 urth.org urth.org f 2010-09-20 15:17:30.55892
5 datetime.perl.org datetime.perl.org f 2010-09-28 17:30:47.261717
\.
use strict;
use warnings;
use Benchmark qw( cmpthese );
my $flag_off = 'A string of medium length containing < 100 characters';
my $flag_on = 'A string of medium length containing < 100 characters';
utf8::upgrade($flag_on);
cmpthese(
@autarch
autarch / gist:6815299
Created October 3, 2013 19:08
Save this as git-rename-branch
#!/usr/bin/env perl
use strict;
use warnings;
use Cwd qw( cwd );
use Git::Wrapper;
my ( $old, $new, $main, $remote ) = @ARGV;
In file included from /usr/include/php5/Zend/zend.h:271:0,
from /usr/include/php5/main/php.h:35,
from /home/autarch/work/MaxMind-DB-Reader-php/ext/php_maxminddb.h:5,
from /home/autarch/work/MaxMind-DB-Reader-php/ext/maxminddb.c:1:
/usr/include/php5/Zend/zend_hash.h: In function 'zend_symtable_update':
/usr/include/php5/Zend/zend_hash.h:352:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:352:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h: In function 'zend_symtable_del':
/usr/include/php5/Zend/zend_hash.h:359:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/include/php5/Zend/zend_hash.h:359:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
use v5.16;
my $int = 1;
for (124..132) {
say "$int >> $_ = ", $int >> $_;
}
------------------
#include <stdio.h>
#include <stdint.h>
int main(int argc, char **argv)
{
uint32_t ui = 1;
int32_t si = 1;
for (int i = 0; i <= 33; i++) {
fprintf(stderr, "unsigned 1 << %i = %u\n", i, ui << i);