Skip to content

Instantly share code, notes, and snippets.

@chrisblackwell
chrisblackwell / post-receive-for-laravel.sh
Last active May 5, 2022 22:40
Git Post receive hook for Laravel deployment
#!/bin/sh
WEBROOT=/srv/www/apps.legendboats.com
GIT_WORK_TREE=$WEBROOT git checkout -f
cd $WEBROOT
# Check if a composer.json file is present
if [ -f composer.json ]; then
# Install or update packages specified in the lock file
composer install
@andycandrea
andycandrea / resources.md
Last active July 10, 2018 19:14 — forked from zporter/resources.md
A list of resources for learning Rails and relevant technologies

A list of resources that aspiring Rails developers can use to learn Rails and other relevant technologies. This list includes some resources that I see recommended all over the web--not all of which I like--as well as some hidden gems that I've found valuable. This list is intended to supplement my blog post here.

Ruby

  • Codecademy
    • One of the more well-known sites to offer interactive programming tutorials, Codecademy is probably best utilized by those who are pretty new to programming, though the Ruby tutorial is good for teaching Ruby syntax and eventually gets into some less trivial material.
  • Try Ruby
  • Pretty similar to Codecademy. Once again, it's beginner-friendly, though, as someone who knew about object-oriented programming beforehand, I found it somewhat annoying to use, as there's no page with links to the individual exercises (at le
#!/usr/bin/env node
var program = require('commander');
var request = require('request');
var chalk = require('chalk');
program
.version('0.0.1')
.usage('[options] <keywords>')
.option('-o, --owner [name]', 'Filter by the repositories owner')
@kroo
kroo / README.md
Last active June 26, 2017 18:11
A quick n' dirty hack to fix a dying GrowlVoice

How to Use

Open up Terminal.app in your /Applications/Utilities directory, then type in these commands, one after each other:

  1. Create a temporary directory for cycript:

    mkdir cycript && cd cycript
    
  2. Pull the latest cycript from cycript.org:

@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@lemiorhan
lemiorhan / post-receive
Last active February 8, 2023 10:06
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@butelo
butelo / callbacks.md
Created January 31, 2014 10:44
Create Callbacks on Android: A Fragment or View makes a Callback to the hosting Activity

Steps to make a Fragment or View to have a Callback to its parent Activity.

Step by step from info taken from here:

http://developer.android.com/guide/components/fragments.html#CommunicatingWithActivity


  • We have an Activity that hosts a Fragment or a View
  • We have a Fragment or View with a ListView or a Button or some element that we want the Activity to know about. i.e. we load detailed info of an element chosen on a ListView or something.
@ryansechrest
ryansechrest / post-receive.sh
Last active February 12, 2017 12:41
Git post-receive hook to deploy WordPress and plugins as submodules. It can also install Node.js modules with npm and vendor packages with Composer.
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying