Skip to content

Instantly share code, notes, and snippets.

View adammcarth's full-sized avatar

Adam McArthur adammcarth

View GitHub Profile
# .github/workflows/example-1.yml
name: My First Manual Workflow
on: [workflow_dispatch]
jobs:
example:
name: Example Job
runs-on: ubuntu-latest
steps:
- name: Clone Repository
[{
"userId": "",
"email": "",
"pin": "",
"recordList": [
{
"type": "discogs",
"id": "<discogs_id>"
},
@adammcarth
adammcarth / homepage.marko
Created November 27, 2015 12:30
Potential navigation bar component in Marko JS
<!-- /src/pages/homepage/homepage.marko -->
<layout-use template="../../layouts/layout.marko" navbar-current="home">
<layout-put into="body">
...
</layout-put>
</layout-use>
module.exports = function(server) {
var request = require("supertest");
it("[GET] /", function(done) {
request(server).get("/").expect(200, done);
});
it("[GET] /posts", function(done) {
request(server).get("/posts").expect(200, done);
});
apache:
install: '1'
settings:
user: www-data
group: www-data
default_vhost: true
manage_user: false
manage_group: false
sendfile: 0
modules:
gulp.task("concat:js", function() {
// Loop through each JS collection and run a seperate concat task
Object.keys(collections.js).forEach(function(name) {
gulp.src(collections.js[name])
.pipe(concatJS("collections/" + name + ".js"))
.pipe(gulp.dest(paths.dest.javascript));
});
});
var gulp = require("gulp");
var collections = require("./collections");
gulp.task("concat-css", function() {
Object.keys(collections).forEach(function(name) {
gulp.src(collections[name])
.pipe(plugins.concatCSS("collections/" + name + ".css"))
.pipe(gulp.dest("assets/stylesheets"));
});
});
# Save the answer into a variable called 'num'.
num = input("How many underscores do you want, yo?: ")
# Multiply "_" by the amount specified before...
underscores = "_" * int(num)
# Print out the smiley face!
print("^" + underscores + "^")
@adammcarth
adammcarth / deploy.sh
Created February 20, 2015 14:15
Deploys code from a GitHub repository to an ec2 instance (or any linux-based VPS).
#!/usr/bin/env bash
source ~/.rvm/scripts/rvm
rvm use
#`deploy.sh` v0.0.1 by Adam McArthur.
# Deploys code from a GitHub repository to an ec2 instance.
# It is reccommended that the current user can use "sudo" without a password [you might need to use sudo from inside this script],
# See: http://askubuntu.com/questions/235084/how-do-i-remove-ubuntus-password-requirement#answer-235088
##### SETTINGS [Change Me] #####
#!/usr/bin/env sh
source ~/.rvm/scripts/rvm
rvm use 2.2.0
app_name="App"
apps_dir="/var/www"
github_username="adammcarth"
git_repo="filthy_parrot"
app_install_commands="bundle install"