Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# A sneaky wrapper around Rubocop that allows you to run it only against | |
# the recent changes, as opposed to the whole project. It lets you | |
# enforce the style guide for new/modified code only, as opposed to | |
# having to restyle everything or adding cops incrementally. It relies | |
# on git to figure out which files to check. | |
# | |
# Here are some options you can pass in addition to the ones in rubocop: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media
This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://<example.com>/<namespace>/<project>/-/jobs/artifacts/<tag>/download?job=pages | |
# https://<example.com>/<namespace>/<project>/-/jobs/artifacts/<tag>/raw/<path_to_file>?job=pages | |
# Where: | |
# example.com - domain name your gitlab server | |
# namespace - your name user on the gitlab | |
# project - your project | |
# tag - ref of current job. | |
# If job run on only by tags, than ref will be named as tag name | |
# If job run on only master, than ref will be named as "master", i.e.: https://<example.com>/<namespace>/<project>/-/jobs/artifacts/master/download?job=pages | |
# path_to_file - path to file relative from root workspace folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test group helpers for creating tables. | |
# The latest version can be gound at https://gist.github.com/lowjoel/bda0d44b48aac2925079 | |
module ActiveRecord::TemporaryTable; end | |
module ActiveRecord::TemporaryTable::TestGroupHelpers | |
# Defines a temporary table that is instantiated when needed, within a `with_temporary_table` | |
# block. | |
# | |
# @param [Symbol] table_name The name of the table to define. | |
# @param [Proc] proc The table definition, same as that of a block given to | |
# +ActiveRecord::Migration::create_table+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GitHub changed the world of open-source. | |
In the beginning it brought together the disconnected programmers who always wanted to work on something with other like-minded people. | |
In the present it's no longer the foreground. Businesses and professionals connect and the profiles become a bragging ground. | |
The GH PR system is stretched to its limits. During the early days this was ok: PRs were few and far between. It worked. | |
I've changed, and so has GitHub. As I grow older I care more about my impact and personal data responsibility. I care about FOSS work being used for profit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I really don't like getting routing error notifications when scanners try to | |
# find vulnerabilities in our application. As such, this extends our routing | |
# to actually give a response, but it's likely not what they were looking for. | |
# If they're not using a headless browser, the `alert` is going to kill their | |
# productivity. If they are, they just might enjoy the youtube video anyway. | |
class AnnoyScannersServer | |
SCANNER_PATHS = %w[ | |
/a2billing/admin/Public/index.php | |
/a2billing/common/javascript/misc.js | |
/a2billing/customer/templates/default/css/popup.css |
NewerOlder