Skip to content

Instantly share code, notes, and snippets.

View pipwilson's full-sized avatar
💯

Phil Wilson pipwilson

💯
View GitHub Profile
@mayo
mayo / instagram_import.py
Last active May 29, 2021 19:02
Import instagram data into a static site (Jekyll, Hugo, Hana, Metalsmith, etc)
import codecs
from datetime import datetime
import json
import os
import posixpath
import re
import shutil
import sys
# This script will import your instagram photos to your static site. It should work for most, assuming you customize the POST_TEMPLATE to match what your site uses.
@aaronhoffman
aaronhoffman / pre-commit
Created April 14, 2017 15:25
git hooks - prevent commit to local master branch and prevent push to remote master branch
#!/bin/sh
# prevent commit to local master branch
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "pre-commit hook: Can not commit to the local master branch."
exit 1
fi
exit 0
#=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')
@pixelhandler
pixelhandler / pre-push.sh
Last active April 8, 2024 01:04
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@p1nox
p1nox / ccopter.rake
Last active December 12, 2015 09:58
Copycopter Offline: using copycopter only on development environment
namespace :ccopter do
desc "Split copycopter yml file"
task :split_ccopter_file => :environment do
CCOPTER_FILE = "#{Rails.root}/config/locales/copycopter.yml"
created_files = 0
if File.exists?(CCOPTER_FILE)
CCOPTER = YAML.load_file(File.open(CCOPTER_FILE))
@stefang
stefang / The HAML
Created September 2, 2011 11:23
Hide labels, but show on focus to replace the hidden placeholder text as a reminder
%form
%ol
%li
%label.hidden(for="the_input") The label text
%input(name="the_input" placeholder="the placeholder text")
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@davetron5000
davetron5000 / Checkstyle pre-commit hook
Created December 18, 2008 02:40
Pre Commit Hook for running checkstyle on changed files
#!/usr/bin/perl
#
# Pre-commit hook for running checkstyle on changed Java sources
#
# To use this you need:
# 1. checkstyle's jar file somewhere
# 2. a checkstyle XML check file somewhere
# 3. To configure git:
# * git config --add checkstyle.jar <location of jar>
# * git config --add checkstyle.checkfile <location of checkfile>