Skip to content

Instantly share code, notes, and snippets.

#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main (int argc, char **argv) {
char *str;
long n;
if (argc < 2) {
@sproctor
sproctor / gist:9236068
Created February 26, 2014 18:58
pcf error message
~/code/pcf $ make
ocaml setup.ml -configure
Configuration:
ocamlfind: ........................................... /home/sproctor/.opam/system/bin/ocamlfind
ocamlc: .............................................. /usr/bin/ocamlc.opt
ocamlopt: ............................................ /usr/bin/ocamlopt.opt
ocamlbuild: .......................................... /usr/bin/ocamlbuild
Package name: ........................................ pcf
Package version: ..................................... 0.0.1
@sproctor
sproctor / feature.md
Created March 28, 2017 13:23
pkgconfig-depends suggestion

Some packages, specifically Lua, do not have a standard name in their pkg-config. Lua 5.1 could be one of lua51, lua5.1, lua-5.1, or lua. It would be nice to have an "or" feature in pkgconfig-depends so I could write that as:

pkgconfig-depends: lua51 || lua5.1 || lua-5.1 || (lua >= 5.1, lua < 5.2)

@sproctor
sproctor / main.rs
Last active July 24, 2017 19:27
colony working draft
use std::io::Write;
use std::net::TcpListener;
use std::net::TcpStream;
use std::thread;
fn main() {
println!("Creating server");
// let ip = Ipv4Addr::new(127, 0, 0, 1);
let port = 9000;
@sproctor
sproctor / bad.c
Last active August 10, 2017 17:59
wtf? a good example of bad
void function_name ()
{
for (d = first_descriptor; d; d = d->next)
{
if (condition1)
{
stuff1();
continue;
}
else if (condition2)
@sproctor
sproctor / index.php
Last active December 19, 2017 16:22
<?php
require __DIR__.'/vendor/autoload.php';
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage;
[charles-cotesworth]$ raco pkg install sxml
standard-module-name-resolver: collection not found
for module path: (lib "raco/main.rkt")
collection: "raco"
in collection directories:
/home/sproctor/.racket/6.12/collects
context...:
show-collection-err
standard-module-name-resolver
@sproctor
sproctor / generate-prices.sh
Created March 31, 2018 14:31
generate prices script
#!/bin/sh
if [ ! -f prices/template.html ]; then
cp prices/index.html prices/template.html
fi
./catty-scrape.py > output.temp
sed '/%content%/{
s/%content%//g
r output.temp
#!/usr/bin/env python
import codecs
import sys
import urllib2
from bs4 import BeautifulSoup
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
page_url = 'https://iscrapapp.com/yards/us-pennsylvania-catasauqua-catasauqua-scrap-yard-premium/pricing/'
sproctor@nickel:~/Code/ScrapReceipts$ elm-package install elm-community/list-extra
To install elm-community/list-extra I would like to add the following
dependency to elm-package.json:
"elm-community/list-extra": "7.1.0 <= v < 8.0.0"
May I add that to elm-package.json for you? [Y/n] y
Error: I cannot find a set of packages that works with your constraints.