Skip to content

Instantly share code, notes, and snippets.

View Nicd's full-sized avatar

Mikko Ahlroth Nicd

View GitHub Profile
get_number = fn (text) ->
case Regex.run(~r/\w (\d+)/, text) do
[_, number]
-> number
_
-> nil
end
end
"10" = _number = get_number.("a 10")
@Nicd
Nicd / weechat_nicd.service
Created April 28, 2015 09:22
Systemd service autostarting WeeChat in a tmux session on boot
[Unit]
Description=WeeChat in a tmux server for nicd
[Service]
Type=forking
User=nicd
ExecStart=/home/weechat_start
[Install]
WantedBy=multi-user.target
@Nicd
Nicd / gulpfile.js
Last active August 29, 2015 14:21
// Node modules
var fs = require('fs'), vm = require('vm'), chalk = require('chalk');
// Gulp and plugins
var gulp = require('gulp'), concat = require('gulp-concat'),
replace = require('gulp-replace'), uglify = require('gulp-uglify');
// Gulp minify for smallinizing our CSS
var minify = require('gulp-minify-css');
@Nicd
Nicd / blog.nytsoi.net
Created October 29, 2015 17:20
nginx configuration for HTTPS
server {
listen 80;
listen [::]:80;
server_name blog.nytsoi.net;
location / {
rewrite ^ https://$server_name$request_uri permanent;
}
}
<?php include "../includes/session_start.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin Overall</title>
<link rel="stylesheet" href="style/content.css" type="text/css" media="screen" />
<link rel= "stylesheet" type="text/css" href= "Styles/userscss.css" />
<link rel= "stylesheet" type="text/css" href= "Styles/sidebars.css" />
@Nicd
Nicd / #payday.log
Last active November 26, 2015 21:27
IRC logs from #payday @ QuakeNet regarding the group order
----
2014-11-24T15:32:58+0200 @Nicd but looks like we're going to have to wait since some of that stuff is only available january 2015
2015-05-04T15:06:18+0300 @Nicd ha, now the dozer bobblehead's ETA has been moved back to 15th of May
2015-05-04T15:06:23+0300 @Nicd but the suit shirts have been moved to June
2015-07-02T14:17:23+0300 @usvi Nicd: when did we order actually? I have lost trace
2015-07-02T14:18:44+0300 @Nicd november
[Unit]
Description=codestats.net server
After=postgresql.service
[Service]
Type=simple
User=codestats
ExecStart=/var/codestats/codestats/run.sh
WorkingDirectory=/var/codestats/codestats
@Nicd
Nicd / call.sh
Created December 31, 2016 15:15
Code::Stats profile API suggestion
curl -X GET 'http://localhost:5000/api/users/Nicd'
@Nicd
Nicd / frontend.build.ex
Last active January 18, 2017 06:18
Building frontend with Mix Tasks
defmodule Mix.Tasks.Frontend.Build do
use Mix.Task
import CodeStats.TaskUtils
@shortdoc "Build the frontend"
def run(_) do
run_tasks([
"frontend.build.riot",
"frontend.build.scss"
@Nicd
Nicd / app.tpl.php
Last active March 3, 2017 23:05
PHP project base with MVT model, simple middleware system, DB basics, router, templates with shared layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Blah blah lorem ipsum.">
<meta name="author" content="Mikko Ahlroth">
<title>My Great Website</title>