Skip to content

Instantly share code, notes, and snippets.

View cecyc's full-sized avatar
🙈

Cecy Correa cecyc

🙈
View GitHub Profile

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 / new_computer.sh
Last active August 17, 2022 15:26
Essentials for a new computer install
#install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#install apps
brew install --cask google-chrome
brew install --cask spotify
@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)))
}
@cecyc
cecyc / scp_cli.md
Last active May 15, 2017 15:04
Copying remote files via CLI

How to copy a file in a remote onto your local machine:

scp REMOTE:FILENAME ./

REMOTE: where the file is FILENAME: the file you want to copy ./ where the file will be copied to (do not have to name it as it will use the name of the file in the remote

You can run a SQL query and pipe into a file on a remote location, then use method above to copy locally.

@cecyc
cecyc / docker-compose.yml
Created September 16, 2016 19:54
Sample Docker Compose file for a simple WordPress setup
version: '2' #The Docker Compose file format version to be used
services:
database: #The name of the container, you can name this whatever you want.
image: mysql:latest #The image you are pulling into the container
environment:
MYSQL_ROOT_PASSWORD: tacos
MYSQL_DATABASE: tacos
MYSQL_USER: tacos
MYSQL_PASSWORD: tacos
@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 / 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 / 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.