Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Author: Daniel Draper
# Credit:
# - https://github.com/vdka/dotfiles/
# - https://github.com/mathiasbynens/dotfiles
# Install rbenv.
brew install rbenv
#!/usr/bin/env bash
# Author: Daniel Draper
# Credit:
# - https://github.com/vdka/dotfiles/
# - https://github.com/mathiasbynens/dotfiles
# Ask for the administrators password.
sudo -v
#!/usr/bin/env bash
# Author: Daniel Draper
# Credit:
# - https://github.com/vdka/dotfiles/
# - https://github.com/mathiasbynens/dotfiles
# Ask for the administrators password.
sudo -v
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@subfuzion
subfuzion / curl.md
Last active May 1, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jamtur01
jamtur01 / ladder.md
Last active April 28, 2024 20:07
Kickstarter Engineering Ladder
@matthieubulte
matthieubulte / p-a-t.md
Last active October 4, 2015 21:22
Propositions as Types

List of papers (with links to the PDF versions) mentioned in Philip Wadler's presentation on Propositions as Types at StrangeLoop 2015 (https://www.youtube.com/watch?v=IOiZatlZtGU)

#Make sure the postgres App is running on computer
#Carrierwave works with ORM such as Active Record and Datamapper;
rails new carrier_wave_app -d postgresql
add production and development database to database.yml #make sure you do not add one of the fields to production
rails g scaffold art_galleries name:string location:string avatar:text #Also create the table in migrations folder;
#Is it added to the protected attributes method in the controller;
#Add root_to in the config.routes;
gem 'carrierwave'
rails generate uploader Avatar #Give you a class in app/uploaders/avatar_uploader.rb
rails g migration add_avatar_to_art_galleries avatar:string
@edelpero
edelpero / heroku_rails_phantomjs.md
Last active May 10, 2021 08:31
Heroku, Ruby on Rails and PhantomJS

#Heroku, Ruby on Rails and PhantomJS

In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).

Let’s get started. This is a high-level overview of the required steps:

  • Modify your app to use multiple Heroku buildpacks.
  • Extend your app to use both the Ruby as well as the PhantomJS buildpacks.
  • Confirm that everything worked.