Skip to content

Instantly share code, notes, and snippets.

@chris-ramon
chris-ramon / reflection.go
Created June 26, 2016 21:46 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@chris-ramon
chris-ramon / pycharm_installation.py
Last active June 4, 2016 10:32
installing pycharm on ubuntu.
sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
download pycharm
cd bin
chmod u+x
./pycharm.sh
:noremap tt :tab split<CR>
:autocmd BufWritePost *.go :GoImports
set background=light
"unlet g:ctrlp_custom_ignore
"unlet g:ctrlp_user_command
"let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let mapleader = ","
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
@chris-ramon
chris-ramon / gist:bc1c2240468b124ac2e7
Last active February 25, 2016 05:08
webpack notes
# webpack
module.exports = {
entry: "./graphiql.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.jsx?$/,
@chris-ramon
chris-ramon / py3.py
Last active January 9, 2016 04:12
python 3 / django - notes
# create an venv
python3 -m venv myvenv
# activate it
python3 -m venv myvenv
# initial migrate
python manage.py migrate
# run migrations
python manage.py makemigrations myapp
@chris-ramon
chris-ramon / sketch.sh
Last active January 7, 2016 22:08
sketch notes
# plugin to adjust (alt - arrows) margins
# nudg.it
# clone + guide lines
alt - click
# clone
cmd - d
# grid layout
@chris-ramon
chris-ramon / gql.go
Created January 6, 2016 00:46
graphql go new api
//
package main
import (
"log"
"github.com/graphql-go/graphql"
)
type Schema struct {
@chris-ramon
chris-ramon / ruby_args.rb
Created January 23, 2014 22:00
ruby_args.rb
def bar(x, y, *args)
puts x, y
puts "args: #{args}"
end
bar(*[1, 2, 3, 5])
@chris-ramon
chris-ramon / rails.sh
Last active January 4, 2016 03:39
rails quick dev
# xcode 5.1 error when install thrift
bundle config build.thrift --with-cppflags='-D_FORTIFY_SOURCE=0'
# When debugging in ruby 2.1.0
# error: cannot find vm_core.h
# we have to downgrade to ruby 2.0.0
# to start using -> ruby-debug-ide
# Nokogiri and libxml
# Reason: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later,
@chris-ramon
chris-ramon / ruby_threads.rb
Created January 22, 2014 01:10
ruby threads
#!/usr/bin/ruby
def fun1
5.times do |i|
puts "from FUNCTION ONE #{i.to_s}"
sleep(2)
end
end
def fun2
5.times do |i|