Skip to content

Instantly share code, notes, and snippets.

View ricbermo's full-sized avatar

Ricardo Berdejo ricbermo

  • Fullstack Labs
  • Barranquilla, Colombia
  • 00:16 (UTC -05:00)
  • X @ricbermo
View GitHub Profile
@sgon00
sgon00 / dart.vim
Created December 4, 2018 09:50
Put it at `~/.vim/after/syntax/dart.vim` to add/override anything in `~/.vim/bundle/dart-vim-plugin/syntax/dart.vim`.
syn match dartFunction "\zs\(\k\w*\)*\s*\ze("
hi! link dartFunction Function
syn match myCamelCase '\v(<_*\u\i*>)+'
hi! link myCamelCase Type
syntax keyword flutterConstant immutable kAlwaysCompleteAnimation kAlwaysDismissedAnimation
\ kBackMouseButton kBottomNavigationBarHeight kDoubleTapMinTime kDoubleTapSlop kDoubleTapTimeout
\ kDoubleTapTouchSlop kElevationToShadow kFloatingActionButtonMargin kFloatingActionButtonSegue
\ kFloatingActionButtonTurnInterval kForwardMouseButton kHoverTapSlop kHoverTapTimeout kJumpTapTimeout
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created
return
else
@yortz
yortz / carrierwave.rb
Created November 27, 2010 16:49
image_uploader.rb
#config/initializers/carrierwave.rb
CarrierWave.configure do |config|
if Rails.env.production? or Rails.env.development?
config.storage :cloud_files
config.cloud_files_username = "your_username"
config.cloud_files_api_key = "your_key"
config.cloud_files_container = "test"
config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com"
def store_dir
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111