Skip to content

Instantly share code, notes, and snippets.

View katpadi's full-sized avatar
🎯
Focusing

Kat Padilla katpadi

🎯
Focusing
View GitHub Profile
@katpadi
katpadi / Docker Notes
Created June 15, 2014 15:59
Docker Cheat Sheet
Like "ls"
docker images
Like "rm" in linux -- change "<none>" to something relevant
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
Delete all images
docker rmi $(docker images -q)
Delete all containers
@katpadi
katpadi / WPxNGINX
Created July 7, 2014 14:17
WordPress x NGINX
server {
server_name blog.katpadi.ph www.blog.katpadi.ph;
access_log /var/log/nginx/katpadi.ph.access.log;
error_log /var/log/nginx/katpadi.ph.error.log;
root /var/www;
index index.php;
location / {
@katpadi
katpadi / wp.gitignore
Created July 11, 2014 09:15
WordPress Development Typical .gitignore Setup
# WordPress Deployment Typical .gitignore Setup
# Lesson Learned: You don't want WordPress core files in your repository!
# I usually use this inside "wp-content"
# Ignore everything in the "wp-content" directory, except the .gitignore
/*
!.gitignore
# Ignore everything in the "wp-content" directory, except the "themes" directory
# Then do NOT ignore some-theme-you-want-to-ignore
@katpadi
katpadi / MixCo-1
Last active August 29, 2015 14:03
MixCo-1
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
</head>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
@katpadi
katpadi / UBUNTU_FUCKED_UP
Last active August 29, 2015 14:04
UBUNTU_FUCKED_UP
1 #############################################################
2 ################### OFFICIAL UBUNTU REPOS ###################
3 #############################################################
4
5 ###### Ubuntu Main Repos
6 deb http://us.archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
7 deb-src http://us.archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
8
9 ###### Ubuntu Update Repos
10 deb http://us.archive.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
@katpadi
katpadi / README.md
Last active August 29, 2015 14:04
Docker x Fig x WordPress

Docker x Fig x WordPress

Personal notes for my local WP development environment. Because I used to run Vagrant then, I took an arrow to the knee.


Install Docker, m*therfucker.

sudo sh -c "echo deb https://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list" 
sudo apt-get update 
sudo apt-get install lxc-docker
@katpadi
katpadi / TitanStuff
Created August 8, 2014 09:39
Sample
<?php
class TitanStuff {
function __construct( ) {
$this->init();
}
function init() {
$this->titan = TitanFramework::getInstance( '_s' );
#!/bin/bash
maxdelay=$((16*60)) # 16 hours from 2am to 11pm, converted to minutes
for ((x=1; x<=24; x++)); do
# pick random delay for each of the 24 runs
delay=$(($RANDOM%maxdelay))
# background a subshell to wait, then run
(sleep $((delay*60)); cd /apps/xdaysb4nba && ruby fave.rb || echo "ERROR!") &
done
@katpadi
katpadi / gist:425ea20db85d141e4328
Created September 26, 2014 20:01
cron for bot
#!/bin/bash
echo `date` >> /tmp/autofaves.log
maxdelay=$((16*60)) # 16 hours from 2am to 11pm (in minutes)
for ((x=1; x<=24; x++)); do
# pick random delay for each of the 24 runs
delay=$(($RANDOM%maxdelay))
# background a subshell to wait, then run
(sleep $((delay*60)); cd /apps/xdaysb4nba && ruby fave.rb || echo "ERROR!") &
done
@katpadi
katpadi / gist:313c8951e3d39a27882c
Created October 13, 2014 10:20
MyAwesomeTasks Simple RSpec
require 'rails_helper'
describe 'MyAwesomeTasks' do
let!(:dummy_task) { create :my_awesome_task }
describe "Tasks Form" do
subject { page }
it { is_expected.to have_field('my_awesome_task[title]') }
it { is_expected.to have_field('my_awesome_task[description]') }
it { is_expected.to have_field('my_awesome_task[content]') }