Skip to content

Instantly share code, notes, and snippets.

View Yeboster's full-sized avatar
🧜
Surfing life's waves

Marco Yeboster

🧜
Surfing life's waves
View GitHub Profile
@rxw1
rxw1 / .vimrc
Created March 27, 2015 00:41
My slow vim config
" http://www.github.com/rwilhelm/dotfiles/vimrc
" Tue Jun 17 01:33:55 CEST 2014
" 2007-2014 (c) [email protected]
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@olgakogan
olgakogan / sql_alchemy_samples.py
Last active February 7, 2023 22:49
SQL Alchemy Samples
########## CASE IN UPDATE STATEMENT ############
from sqlalchemy import case
# single value modification (the 'else' is not mandatory)
session.query(User).update({User.status : case([(User.status == "pending", "approved")], else_=User.status)}, False)
# multiple values modification
session.query(User).update({User.status : case([(User.status == "pending", "approved"),
(User.status == "waiting", "deprecated_status")])}, False)
@lfender6445
lfender6445 / gist:9919357
Last active May 13, 2025 16:00
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@prwhite
prwhite / Makefile
Last active July 10, 2025 14:33
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@podhmo
podhmo / sqlalchemy_example.py
Created December 20, 2012 14:59
sqlalchemy query example.
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)
@jackii
jackii / gist:3722043
Created September 14, 2012 13:53 — forked from mark-ellul/gist:3531320
Email Boilerplate as HAML with yield to use as layout in Rails actionmailer
!!! Strict
%html{:xmlns => "http://www.w3.org/1999/xhtml"}
%head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
%title Your Message Subject or Title
:css
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
@marianoviola
marianoviola / README.md
Last active October 10, 2018 10:52
Vim digest

Editing with Vim

Modes

i Insert mode at cursor 
I Insert at beginning of line 
a Append at cursor 
A Append at the end of line
v visual mode

escape Exit insert mode