Skip to content

Instantly share code, notes, and snippets.

View sondr3's full-sized avatar
:octocat:
Rust or bust

Sondre Aasemoen sondr3

:octocat:
Rust or bust
View GitHub Profile
@sondr3
sondr3 / gist:6171581
Created August 7, 2013 05:55
Apache 2.4 init.d script for Debian 7
#!/bin/sh
### BEGIN INIT INFO
# Provides: apache2
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: apache2
# Description: httpd server for serving web content
### END INIT INFO
@sondr3
sondr3 / gist:6171632
Created August 7, 2013 06:08
Linode optimization
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 6
MaxSpareServers 12
MaxClients 30
MaxRequestsPerChild 3000
</IfModule>
@sondr3
sondr3 / website1.conf
Last active December 20, 2015 21:09
Configurations for your website to use as an example.
# www to non-www redirect -- duplicate content is BAD:
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536$
# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
server {
# don't forget to tell on which port this server listens
listen 80;
# listen on the www host
server_name www.yourwebsite.com;
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "localhost";
.port = "8080";
}
YeomanGenerator.prototype.askForThings = function askForThings() {
var cb = this.async();
var prompts = [{
name: 'questionOne',
type: 'list',
message: 'Message, message?',
choices: ['optionOne', 'optionTwo', 'optionThree', 'optionFour', 'optionFive', 'optionSix', 'None'],
filter: function(value) {
return value.toLowerCase();
}
// Default task, run when just writing 'gulp' in the terminal
gulp.task('default', gulp.series(
gulp.series('jekyll:dev'),
gulp.parallel('styles', 'javascript', 'fonts', 'images'),
gulp.series('inject:head:dev', 'inject:footer:dev'),
gulp.series('serve')
));
gulp.task('build', gulp.series(
@sondr3
sondr3 / gulpfile.babel.js
Created August 29, 2015 18:42
Gulpfile v2
gulp.task('assets:dev', gulp.series('styles:dev', 'javascript:dev', 'fonts', 'images'));
gulp.task('assets', gulp.series('styles', 'javascript', 'fonts', 'images'));
// Default task, run when just writing 'gulp' in the terminal
gulp.task('default', gulp.series(
gulp.series('assets:dev'),
gulp.series('inject:head:dev', 'inject:footer:dev'),
gulp.series('jekyll:dev'),
gulp.series('serve')
));
'use strict';
import gulp from 'gulp';
// Loads the plugins without having to list all of them, but you need
// to call them as $.pluginname
import gulpLoadPlugins from 'gulp-load-plugins';
const $ = gulpLoadPlugins();
// Delete stuff
import del from 'del';
// Used to run shell commands
@sondr3
sondr3 / gulpfile.js
Created September 14, 2015 15:50
Gulpfile
// Watch various files for changes and do the needful
gulp.watch(['src/**/*.md', 'src/**/*.html', 'src/**/*.yml'], gulp.series('jekyll:dev', reload));
gulp.watch(['src/**/*.xml', 'src/**/*.txt'], gulp.series('jekyll:dev'));
@sondr3
sondr3 / test.rb
Last active November 21, 2015 21:23
# bin/test.rb
opts.on('--new:thing [NAME]', 'create a new thing') do |name|
if name.nil?
puts "you need to name your thing"
exit 0
end
options[:name] = name
puts "#{name}"
Test::CLI::New::Thing.new
end