Skip to content

Instantly share code, notes, and snippets.

View cocoanton's full-sized avatar

Anton Kindblad cocoanton

View GitHub Profile
export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH=/usr/local/bin:$PATH
export PATH="$HOME/bin:$PATH"
export PATH=/usr/local/sbin:$PATH
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/:([\1$(parse_git_status)])/"
}
parse_git_status () {
status=$(git status --porcelain 2> /dev/null)
@cocoanton
cocoanton / SeedPussyCats.php
Last active August 29, 2015 14:05
SeedPussyCats.php
<?php
class UserSeeder extends Seeder {
public function run() {
DB::table('style')->truncate();
if (App::environment() !== 'production') {
for($i=0;$i<341;$i++) {
User::create($this->generatePussy(0));
}
@cocoanton
cocoanton / createdeploy.md
Last active August 29, 2015 14:05
Bash script to setup git repository for webserver deployment

##preface This script helps you set up a repository to a webserver so you can deploy files with git. The script is based on the guide on how to do this I found at Digitalocean.com called How to set up automatic deployment with git

This script does a few assumptions

  • your system uses sudo and you are doing this as the user you will connect with ssh
  • you have git installed on the server
  • you and your web server are members of the www-data group

##Setting up the enviorment

@cocoanton
cocoanton / nojs-js
Last active January 2, 2016 11:39
if we have javascript, tell it to the world
<script>document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/,'js');</script>
@cocoanton
cocoanton / print.js
Created November 26, 2013 10:03
Printsnippet
$('.printButton').on('click',function () {
$body = $('body');
content = $body.html();
$body.html($('.printme').html());
window.print();
$body.html(content);
}