Skip to content

Instantly share code, notes, and snippets.

View bryanmikaelian's full-sized avatar

Bryan Mikaelian bryanmikaelian

View GitHub Profile
@soffes
soffes / install.markdown
Last active August 16, 2021 12:25
New computer setup

New Machine

Updated this for the first time in awhile in late 2020.

System Preferences

  • Enable iCloud
  • Disable iCloud mail
  • Display to medium
  • Turn up trackpad speed

Objective-C Coding Convention and Best Practices

Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.

This document is mainly targeted toward iOS development, but definitely applies to Mac as well.

Operators

NSString *foo = @"bar";
@nathansmith
nathansmith / web-design-development-learning-resources.md
Last active May 29, 2024 12:25
Resources for learning web design & front-end development
@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");
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);
@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
@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
module Bus where
import Data.List (find, intercalate)
data BuildStatus = AllGreen
| Borken
deriving (Eq, Show)
data Brogrammer = Johnny
| Arthur
@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
@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'])