Skip to content

Instantly share code, notes, and snippets.

View axilleas's full-sized avatar
🏠
Working from home

Achilleas Pipinellis axilleas

🏠
Working from home
View GitHub Profile
@trident523
trident523 / discourse.conf
Last active February 3, 2019 16:18
Simple NGINX forwarding
upstream discourse {
#fail_timeout is optional; I throw it in to see errors quickly
server 127.0.0.1:4578 fail_timeout=5;
}
# configure the virtual host
server {
# replace with your domain name
server_name discourse.example.com;
#=Navigating=
visit('/projects')
visit(post_comments_path(post))
#=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click_on('Button Value')
@johngian
johngian / git-checkout-pr.py
Created April 11, 2014 13:10
git-checkout in github PR
#!/usr/bin/python
import requests
import traceback
import sys
from git import Repo
from optparse import OptionParser
@xiaohanyu
xiaohanyu / nanoc_pandoc.rb
Created March 30, 2014 02:37
Improved nanoc pandoc filter
# This file provide two pandoc filters for html and pdf output
module Nanoc::Filters
class PandocHtml < Nanoc::Filter
identifier :pandoc_html
type :text => :text
def run(content, params = {})
input_format = case item[:extension]
@liquidgecka
liquidgecka / cron_helper.sh
Last active September 28, 2023 15:35
Cron helper
#!/bin/bash
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
Arguments:
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active April 5, 2022 10:30
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@sergeifilippov
sergeifilippov / domain-nginx.conf
Created February 10, 2014 03:22
linux-dash with nginx
server {
server_name $domain_name;
root /var/www;
index index.html index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Cache static files for as long as possible
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
BEFORE:
sam@ubuntu discourse % rm -fr tmp/cache
sam@ubuntu discourse % rm -fr public/assets
sam@ubuntu discourse % time RAILS_ENV=production bin/rake assets:precompile
58.55s user 1.79s system 100% cpu 1:00.02 total
AFTER:
@Lopo
Lopo / PKGBUILD
Last active January 3, 2016 08:29
Source of gitlab package for Arch Linux
moved to https://github.com/Lopo/archlinux-packages