Skip to content

Instantly share code, notes, and snippets.

View cecyc's full-sized avatar
🙈

Cecy Correa cecyc

🙈
View GitHub Profile
@cecyc
cecyc / docker-for-flask.md
Last active July 17, 2018 15:22
Dockerfile and docker-compose for a simple Flask app

Dockerfile

FROM python:3.4
RUN apt-get update -y
RUN apt-get install -y python-pip build-essential
COPY ./path-to-app /app
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
ENV FLASK_APP=app.py
| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|
| boop |
|          |
|__________|
(\_❀) ||
(•ㅅ•) ||
/   づ

Keybase proof

I hereby claim:

  • I am cecyc on github.
  • I am cecyc (https://keybase.io/cecyc) on keybase.
  • I have a public key whose fingerprint is 5DF6 FF0C BB24 64C5 2BBB 9FA5 FDD3 8E80 7EFF 118A

To claim this, I am signing this object:

@cecyc
cecyc / appending_in_go.go
Created October 12, 2017 19:04
How to append objects into a slice in Go
package main
import (
"fmt"
)
type Doggo struct {
Name string
Age int
}
@cecyc
cecyc / .vimrc
Created June 25, 2017 17:08
My very simple vimrc
colorscheme desert
syntax enable "enable language specific syntax
set tabstop=4 "tabs are 4 spaces
set number "show line numbers on the right
set showcmd "show command at bottom
set wildmenu "show autocomplete options
set showmatch "highlight corresponding [{()}]
set laststatus=2 "always show status bar
set splitbelow "set split to bottom
set splitright "set split to right hand side
@cecyc
cecyc / mongo_cheatsheet.md
Last active May 15, 2017 17:14
Mongo DB cheat sheet

MongoDB cheat sheet

For those of you learning Mongo and need a quick reference.

Show databases on the server

show dbs

Use a specific db on the server

@cecyc
cecyc / demystifying_webhooks.md
Last active May 15, 2017 15:10
Demystifying webhooks: A lot of devs don't know what webhooks are. Let's fix that.
@cecyc
cecyc / gem_gotchas.md
Last active May 15, 2017 15:09
Creating your own gem gotchas

Sometimes when you try to run your file, you may get an error because the file is not in your Ruby path. You can:

Run irb -I. to fix this but this is a pain. You could alias irb to irb -I....

You could also use bundle console to open irb with your gem code loaded (assuming that you _are_using bundler).

You could also...

  task :console do
 require 'irb'
@cecyc
cecyc / adding_indexes_sql.md
Last active May 15, 2017 15:08
Adding indexes to MySQL

How to add indexes in MySQL

Basics:

alter table NAME add index <column>

The above works if you are adding an index to just one column. If you need to index different variations:

alter table NAME add index INDEXNAME(things,to,index)

@cecyc
cecyc / go_runes.go
Last active May 15, 2017 15:05
Print out runes in Golang (from Todd McLeod Golang training). Pretty neat for teaching unicode and special characters.
package main
import "fmt"
func main() {
for i := 0; i <= 500; i++ {
//Print the integer, the string of i (rune), and the bytes of i
fmt.Println(i, " - ", string(i), []byte(string(i)))
}