Skip to content

Instantly share code, notes, and snippets.

View run remote mysql phpmyadmin container
docker run --name myadmin -d -e PMA_HOST=mydatabase.com -e PMA_USER=admin -e PMA_PASSWORD=password -p 8080:80 phpmyadmin/phpmyadmin
View rectangularnotch.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
View rectangularnotch.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@everaldo
everaldo / plink-plonk.js
Created Feb 19, 2020 — forked from tomhicks/plink-plonk.js
Listen to your web pages
View plink-plonk.js
View Css inspect
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
@everaldo
everaldo / ReactCarrierwaveImageUploadBlogPost.md
Created Dec 6, 2018 — forked from joemusacchia/ReactCarrierwaveImageUploadBlogPost.md
Upload images with React and the carrierwave Ruby gem for Rails 5
View ReactCarrierwaveImageUploadBlogPost.md

Upload images with React and the carrierwave Ruby gem for Rails 5

I recently attended a 4.5 month, intensive coding bootcamp in Boston, MA called Launch Academy. I spent a lot of time in academic science doing imaging research, so I naturally had an interest in learning how to manipulate images in this new web browser environment. For my capstone project, I created a very simple image editing Rails app where I realized I needed to be able to save/upload images to my database.

Since, through earnest effort, I wanted my app to use React for a single-page experience, and I quickly discovered that my desire to use a React/fetch/carrierwave/fog/Rails strategy was initially difficult to learn. I had to pull information from many sources (StackOverflow, Medium, official docs, other blog posts, course instructors, etc) to develop a method that uses this specific POSTing cycle.

This blog post represents my findings to integrate all these technologies in a modern, seamless

@everaldo
everaldo / passenger_process_monitor.rb
Created May 15, 2018 — forked from dazoakley/passenger_process_monitor.rb
Script for killing errant passenger processes
View passenger_process_monitor.rb
#!/usr/bin/env ruby
#
# Passenger Process Monitor
#
# By Darren Oakley
# Based heavily on a script by James Smith (https://gist.github.com/851520)
# That in turn was based on a similar script by Jon Bettcher
#
# - Check memory usage of all paseenger child process and kill if grows too large.
@everaldo
everaldo / rspec_helper.rb
Created Mar 3, 2018 — forked from mlanett/rspec_helper.rb
Helper to clear redis before/after examples in rspec.
View rspec_helper.rb
=begin
Include in your rspec config like so:
RSpec.configure do |spec|
spec.include RSpec::RedisHelper, redis: true
end
This helper will clean redis around each example.
=end
View webpack-rails-1.markdown

Webpack with Rails Part 1

I don't like Sprockets, but it's the easiest and best choice for lots of Ruby on Rails projects. When looking for a better way to manage my JavaScript assets and an improved developer story, my current tool of choice is webpack. While I wish Rails supported drop-in asset pipelines the way that Phoenix does, it's not hard to use webpack with Rails.

@everaldo
everaldo / Queue_with_two_stacks.rb
Created Aug 4, 2017
Exercício do Hacker Ranking - me deu bastante trabalho, porque o código dá timeout. Otimizei bastante, depois deu pra simplificar
View Queue_with_two_stacks.rb
# Enter your code here. Read input from STDIN. Print output to STDOUT
class Queue
def initialize
@current_stack = []
@aux_stack = []
end
def enqueue(x)
You can’t perform that action at this time.