This is a basic guide on hardening your Debian VPS. And Ubuntu users may also find this guide useful, since Ubuntu is based on Debian.
Don't panic!
require "coffee-script" | |
module Jekyll | |
# Automatically force coffeescript files to be compiled, even if they don't | |
# have the YAML front-matter. | |
class CoffeeConvertor < Generator | |
def generate(site) | |
converted = [] | |
site.static_files.each do |sf| |
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project' | |
require 'motion-cocoapods' | |
require 'bundler' | |
Bundler.require | |
Dir.glob('lib/tasks/*.rake').each { |r| import r } | |
VERSION = "1.0.2" |
#!/usr/bin/env ruby | |
if `git diff --cached spec` =~ /,\s?(:focus|focus:\s?true|:focus\s?=>\s?true)/ | |
puts "\e[31mPlease focus and remove your :focus tags before committing :)" | |
exit 1 | |
end |
from django.forms import ModelForm | |
from django.forms.models import inlineformset_factory | |
from models import Sponsor, Sponsorship | |
class SponsorForm(ModelForm): | |
class Meta: | |
model = Sponsor |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |
# Video of it in action: http://cl.ly/VSIF | |
class MyScene < SKScene | |
def scroll_action(x, duration) | |
width = (x * 2) | |
move = SKAction.moveByX(-width, y: 0, duration: duration * width) | |
reset = SKAction.moveByX(width, y: 0, duration: 0) | |
SKAction.repeatActionForever(SKAction.sequence([move, reset])) | |
end |
## | |
# Helpers for randomized person testing. | |
module PersonsHelper | |
## | |
# Generate the next n elements for the array, but in a predefined manner. | |
class FakeElementGenerator | |
## | |
# Generate elements, the first of which must be start_with. | |
def initialize(start_with:) | |
@start = start_with |
<div class="canvas-con"> | |
<div class="canvas-con-inner"> | |
<canvas id="mychart" height="250px"></canvas> | |
</div> | |
<div id="my-legend-con" class="legend-con"></div> | |
</div> |