Skip to content

Instantly share code, notes, and snippets.

View bryanmikaelian's full-sized avatar

Bryan Mikaelian bryanmikaelian

View GitHub Profile
@ldez
ldez / gmail-github-filters.md
Last active June 9, 2024 05:23
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@phuphighter
phuphighter / mediaqueries.css
Created June 29, 2016 14:10
Semantic UI friendly media queries
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
[class*="tablet only"]:not(.mobile),
[class*="computer only"]:not(.mobile),
[class*="large screen only"]:not(.mobile),
[class*="widescreen only"]:not(.mobile),
[class*="or lower hidden"] {
display: none !important;
}
@popravich
popravich / PostgreSQL_index_naming.rst
Last active May 30, 2024 06:39
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@henrik
henrik / config--initializers--rails4_to_rails3_downgradability.rb
Created June 18, 2015 09:55
Fix "NoMethodError: undefined method `sweep'" error when downgrading from Rails 4 to Rails 3.
# Without this fix, downgrading from Rails 4 to Rails 3 causes session cookies to blow up.
#
# The way the flash is stored in the session changed in a backwards-incompatible way.
if Rails::VERSION::MAJOR == 3
module ActionDispatch
class Flash
def call(env)
if (session = env['rack.session']) && (flash = session['flash'])
@bryanmikaelian
bryanmikaelian / metal_controller.rb
Created April 12, 2015 02:34
ActionController::Metal Necessary Modules
class MetalController < ActionController::Metal
include AbstractController::Rendering
include ActionView::Layouts
include ActionController::Serialization
include ActionController::Rendering
include ActionController::Renderers::All
include ActionController::Redirecting
include AbstractController::Callbacks
include AbstractController::Helpers
include ActionController::ParamsWrapper
module Bus where
import Data.List (find, intercalate)
data BuildStatus = AllGreen
| Borken
deriving (Eq, Show)
data Brogrammer = Johnny
| Arthur
@mulder
mulder / ar_patch.rb
Created March 20, 2012 11:21
Patch Mysql2 Adapter for AR so that we don't show tables every other request
unless Rails.env.development?
require "active_record/connection_adapters/mysql2_adapter"
module ActiveRecord
module ConnectionAdapters
class Mysql2Adapter < AbstractAdapter
extend ActiveSupport::Memoizable
memoize :tables, :pk_and_sequence_for, :columns
end
end
@jessedearing
jessedearing / vim cheatsheet.md
Last active April 1, 2022 18:05
Vim Cheatsheet

#Vim Cheat Sheet

  • gqip - Reformats paragraph to textwidth
  • gq - Reformats selection
  • :Tab /= - Equally spaces based on the = symbol (requires Tabular vim plugin)
  • :setf language - Changes current language
  • :set language=language - Changes current language
  • <C-a> - Increments the number under the cursor
  • <C-x> - Decrements the number under the cursor
  • ~ - Toggles case and moves to next character in normal mode
var querystring = require('querystring');
var http = require('http');
var util = require('util');
exports.process = function(message, sayCallback) {
if(message.indexOf('generate meme') !== -1) {
var params = message.split(' ');
if(exports.types[params[2]]) {
var linesRegex = new RegExp(params[2] + " (.*) / (.*)");
var lines = linesRegex.exec(message);
@bryanmikaelian
bryanmikaelian / programmerTest.cs
Created June 17, 2011 13:40
OO Programmer test (C#)
using System;
namespace Programmer {
public class Skillz {
public static void Main() {
Console.WriteLine("Round 1. CODE!");
Console.WriteLine("--------------\n");