Skip to content

Instantly share code, notes, and snippets.

View rchrd2's full-sized avatar

Richard Caceres rchrd2

View GitHub Profile
@rchrd2
rchrd2 / README.md
Last active November 15, 2017 07:20
wav2mp3
                     
 ___       ___     ____     __    __     ______      __    __     _____   _____   
(  (       )  )   (    )    ) )  ( (    (____  \     \ \  / /    (  __ \  )__  \  
 \  \  _  /  /    / /\ \   ( (    ) )        ) /     () \/ ()     ) )_) )  __) /  
  \  \/ \/  /    ( (__) )   \ \  / /    __  / /      / _  _ \    (  ___/  (__ (   
   )   _   (      )    (     \ \/ /    /  \/ / __   / / \/ \ \    ) )        \ \  
   \  ( )  /     /  /\  \     \  /    ( () \__/ /  /_/      \_\  ( (      ___/  ) 
    \_/ \_/     /__(  )__\     \/      \__\____(  (/          \) /__\     )____/  
                                                                                  
@rchrd2
rchrd2 / admin.py
Last active March 3, 2022 00:14
Adding custom views to django's admin
from django.contrib import admin
from polls.models import Poll, Choice
from django.contrib.auth.models import User
from django.contrib.admin import AdminSite
from polls.views import index
class MyAdminSite(AdminSite):
@rchrd2
rchrd2 / Procfile
Last active August 29, 2015 14:17
sandbox-html5-template
web: php -S 0.0.0.0:8000 -t .
#gulp: gulp watch
@rchrd2
rchrd2 / redis-output.txt
Created January 18, 2015 03:37
Redis output
nst>brew install redis
==> Downloading http://download.redis.io/releases/redis-2.8.12.tar.gz
######################################################################## 100.0%
==> make -C /private/tmp/redis-qA8O/redis-2.8.12/src CC=clang
==> Caveats
To have launchd start redis at login:
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
Then to load redis now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Or, if you don't want/need launchctl, you can just run:
@rchrd2
rchrd2 / install.sh
Last active August 29, 2015 14:13
Install psycopg2 on Yosemite
export PATH=/Applications/Postgres.app/Contents/Versions/9.4/bin/:$PATH
pip install psycopg2
@rchrd2
rchrd2 / commands.txt
Last active August 29, 2015 14:13
Dokku breaks with file
>git commit -a -m 'add index'
gi[master 5377c90] add index
1 file changed, 547 insertions(+)
create mode 100755 public/vf/index.html
>git push sandbox master
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
@rchrd2
rchrd2 / index.php
Created January 2, 2015 23:09
Include protect.php to password protect a page
<?php include 'protect.php';?>
<!DOCTYPE html>
<html>
<head></head>
<body>Secrets. </body>
</html>
@rchrd2
rchrd2 / Projects.md
Last active August 29, 2015 14:12
Dokku (dokku-alt) example projects.
@rchrd2
rchrd2 / add_swap.sh
Last active August 12, 2017 01:18
Create memory swap (virtual memory) on ubuntu
sudo swapon -s
free -m
df -h
# 2G, 4G, etc
sudo fallocate -l 2G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
@rchrd2
rchrd2 / player.js
Created December 19, 2014 09:23
Videojs BigPlayButton Play Pause
videojs.BigPlayButton.prototype.onClick = function(){
if(this.player_.paused()) {
this.player_.play();
} else {
this.player_.pause();
}
};