Skip to content

Instantly share code, notes, and snippets.

View butlerx's full-sized avatar
:shipit:
shiping all the things

Cian Butler butlerx

:shipit:
shiping all the things
View GitHub Profile
@butlerx
butlerx / models.rs
Last active April 1, 2018 11:51
stv_db
use std::time::SystemTime;
#[derive(Queryable)]
pub struct Election {
pub id: i32,
pub title: String,
pub draft: bool,
pub candidates: Vec<i32>,
pub created_at: SystemTime,
pub started_at: SystemTime,
@butlerx
butlerx / main.rs
Created March 19, 2018 15:06
Multiples of 3 and 5
fn get_num() -> u64 {
let mut input = String::new();
match std::io::stdin().read_line(&mut input) {
Ok(_n) => match input.trim().parse::<u64>() {
Ok(n) => n,
Err(_error) => 0,
},
Err(_error) => 0,
}
}
@butlerx
butlerx / test1.ccal
Created November 5, 2017 14:49
CCal examples
main
begin
// a simple comment
/* a comment /* with /* several */ nested */ comments */
end
@butlerx
butlerx / pre-commit.sh
Last active September 24, 2017 12:10
dns increament
#!/usr/bin/env bash
# Increamet dns serial after config change
# place in .git/hooks/pre-commit
set -e
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
exit 1
fi
@butlerx
butlerx / docker-compose.yml
Created June 3, 2017 16:02
intro to docker
version: '2'
services:
nginx:
image: nginx
container_name: nginx
restart: 'always'
ports:
- '80:80'
- '443:443'
volumes:
@butlerx
butlerx / generateVhost.js
Created May 29, 2017 16:17
original script to generate vhost
#!/bin/node
//ldapsearch -D cn=root,ou=ldap,o=redbrick -xLLL -y /etc/ldap.secret objectClass uid gidNumber > entry.ldif
const fs = require('fs');
const _ = require('lodash');
const ldif = require('ldif');
const file = ldif.parseFile('./entry.ldif');
const users = [];
@butlerx
butlerx / pylint.txt
Last active April 28, 2017 21:35
useradm pylint
************* Module rbaccount
W:131, 0: XXX Should check this before we rename user in ldap, have a (fixme)
W:184, 0: XXX (fixme)
W:257, 0: TODO (fixme)
W:262, 0: TODO (fixme)
E: 84,53: Too many positional arguments for function call (too-many-function-args)
R:264, 4: Too many arguments (7/5) (too-many-arguments)
R: 30, 0: Too many public methods (22/20) (too-many-public-methods)
************* Module rbconfig
W:220, 0: XXX: need files for carbon now aswell. (fixme)
@butlerx
butlerx / gitea _postgress_errors.md
Last active April 24, 2017 12:39
gitea invalid byte sequence
db_1     | STATEMENT:  SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_cdb_1     | ERROR:  invalid byte sequence for encoding "UTF8": 0x80                                                                                                                                                                                                                     [146/27020]
db_1     | STATEMENT:  SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "passwd", "login_type", "login_source", "login_name", "type", "location", "website", "rands", "salt", "created_unix", "updated_unix", "last_login_unix", "last_repo_visibility", "max_repo_c
reation", "is_active", "is_admin", "allow_git_hook", "allow_import_local", "allow_create_organization", "prohibit_login", "avatar", "avatar_email", 
<!DOCTYPE html>
<html>
<head>
<title>test php</title> </head>
<body>
<?php
$temp = $_GET["temp"];
if (strlen($temp) != 0) {
temp($temp);
@butlerx
butlerx / flexbox-slider.markdown
Created January 8, 2017 10:08
Flexbox slider

Flexbox slider

Little slider built with flexbox. Somewhat responsive, and can have fixed elements alongside the slider area.

A Pen by Cian Butler on CodePen.

License.