Skip to content

Instantly share code, notes, and snippets.

View lukaszx0's full-sized avatar

Lukasz Strzalkowski lukaszx0

  • Column
View GitHub Profile
@ryanflorence
ryanflorence / angular.js
Last active October 30, 2019 01:42
Comparing an avatar implementation with angular and ember. http://www.angularails.com/articles/creating_simple_directive_in_angular
// Because people can't seem to find the gist description, here is the source
// of this code, a post found in last weeks JS Weekly, it is not my code
// http://www.angularails.com/articles/creating_simple_directive_in_angular
angular.module('ui-multi-gravatar', [])
.directive('multiAvatar', ['md5', function (md5) {
return {
restrict: 'E',
link:function(scope, element, attrs) {
@igrigorik
igrigorik / github.bash
Last active October 23, 2024 10:43
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep [email protected] | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@ssoroka
ssoroka / state_machine.rb
Created August 22, 2013 03:35
State machine in < 100 lines of ruby. No guards. (could be implemented trivially)
module StateMachine
def self.included(klass)
klass.send(:extend, ClassMethods)
klass.instance_eval do
after_initialize :set_initial_state
end
end
module ClassMethods
def state_column
@toolmantim
toolmantim / Makefile
Last active August 21, 2024 20:56
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch

Describing APIs

  • Idea is to have a DSL/structured file that will describe your API

  • Question: is there a repo where people share their Blueprint schemas so we can see them?

    • Not right now. There are definitely plans to make it really open
    • Some people are already sharing their blueprints on GH
  • There are no other ways to collaborate on API design

@steveklabnik
steveklabnik / beer.rb
Last active December 20, 2015 08:59
99 bottles of metaprogrammed beer
class Beer
def sing(start, finish = 0)
start.downto(finish).collect do |number|
verse(number) + "\n"
end.join
end
def verse(number)
Kernel.const_get("Beer::Verse#{number}")
end
@tyre
tyre / gist:5961515
Last active December 19, 2015 13:19
Product Managers Love Features Like Engineers Love Commits

Product managers love features because they are demonstrable proof that shit happened. It can boil down to a shift in blame: you can't blame me that the customer didn't like it, look at this list of things that got done! It's bigger than anyone else's list! It's an objective measure, where 3 hastily crapped out features are better than 1 awesome feature.

Engineers have an equivilent: commits and lines of code. If I'm worried about other engineers or my boss viewing me as unproductive, I can just show a montrous diff and what are you going to say? 'Just Shit It Out' create a massive mess, but at least I can wave my arms around and brag about the sheer quantity of crap that I produced. A phrase we had in college was 'quantity is its own quality.' We were justifying purchasing 2 handles of plastic-bottle vodka over 2 bottles of the nicer stuff.

Quality is harder. It's harder because it takes more thought, more work, and you often get less cumulative things in the end. Oh, you refactored the core logi

defmodule ApplicationRouter do
use Dynamo.Router
prepare do
# Pick which parts of the request you want to fetch
# You can comment the line below if you don't need
# any of them or move them to a forwarded router
conn.fetch([:cookies, :params])
end
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active November 27, 2024 17:06
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@sstephenson
sstephenson / Simple Encryption.md
Created April 11, 2013 23:48
Simple file/stream encryption using OpenSSL

Simple file/stream encryption using OpenSSL

Create and store a 512-byte random encryption key named secret:

$ mkkey secret

Encrypt the contents of file with the secret key and write it to file.enc:

$ encrypt secret < file > file.enc