Skip to content

Instantly share code, notes, and snippets.

View kouky's full-sized avatar

Michael Koukoullis kouky

View GitHub Profile
@nsforge
nsforge / Warnings.xcconfig
Created February 26, 2015 04:39
Standard Xcode Warnings (for use in .xcconfig files)
// Apple LLVM - Warnings - All languages
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
CLANG_WARN_EMPTY_BODY = YES
GCC_WARN_SHADOW = YES
CLANG_WARN_CONSTANT_CONVERSION = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
CLANG_WARN_ENUM_CONVERSION = YES
CLANG_WARN_INT_CONVERSION = YES
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
@rwarbelow
rwarbelow / running_app_in_production_locally.markdown
Created November 11, 2015 18:26
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@RayHughes
RayHughes / SKTexture gradient extension
Last active October 6, 2016 20:42 — forked from craiggrummitt/SKTexture gradient extension
SKTexture gradient extension
/**
Extensions.swift
- Create a linear gradient texture for a SKShapeNode and SKSpriteNode
- UIColor from hex value
- Get (n)th character of a string
- Convert string to float
Based on Extensions.swift by Craig Grummit (https://gist.github.com/craiggrummitt/ad855e358004b5480960)
Swift 2 Compatability by Ray Hughes (https://gist.github.com/RayHughes/3162fcbda6439893b539)
@gwengrid
gwengrid / TypeErasure.swift
Last active September 12, 2018 05:14
Example of type erasure with Pokemon
class Thunder { }
class Fire { }
protocol Pokemon {
typealias PokemonType
func attack(move:PokemonType)
}
struct Pikachu: Pokemon {
typealias PokemonType = Thunder
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)