Skip to content

Instantly share code, notes, and snippets.

View anlek's full-sized avatar
💬
Writing code...

Andrew Kalek anlek

💬
Writing code...
View GitHub Profile
@natcl
natcl / docker-compose.yaml
Last active February 1, 2024 15:02
traefik: node-red + mosquitto using letsencrypt
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api=true"
- "--api.dashboard=true"
@dominicfallows
dominicfallows / Digital Project - Development Contract - Agency (or Company) to Freelancer.md
Last active October 9, 2023 18:47 — forked from malarkey/Contract Killer 3.md
Example contract for use by Creative, Digital and Marketing Agencies (or any company for that matter) to use when contracting a Freelance Web Developer on digital projects.
@ryannealmes
ryannealmes / gist:9c148a6c4b35aefaf505
Last active July 5, 2017 23:08
How to managed services and dependencies ...
# adapted from
# http://adamniedzielski.github.io/blog/2014/11/25/my-take-on-services-in-rails/
class CreateUserAccount
attr_reader :user
def initialize(send_email_service: SendEmail.new, generate_token_service: GenerateToken.new)
@send_email_service = send_email_service
@generate_token_service = generate_token_service
end
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@amiel
amiel / README.md
Last active December 15, 2015 13:08

with_status

Use with_status to run commands and have your arduino let you know when they are done.

with_status starts by turning the LED off before running your command. Once your command completes, it will turn the LED on. Green if the command succeeded, and red if it failed.

I use this with long running commands (such as deploying to heroku), so I can start working on something else without forgetting about my process.

@iambibhas
iambibhas / scopes.txt
Last active May 5, 2024 06:39
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@oyiptong
oyiptong / graphite.md
Created April 20, 2012 18:14 — forked from caged/graphite.md
Installing Graphite on OS X Lion using brew, pythonbrew and virtualenv

This is a general overview (from memory) of the steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

curl -kL http://xrl.us/pythonbrewinstall | bash
echo '[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc' >> ~/.bashrc
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
pythonbrew install 2.7.2
pythonbrew use 2.7.2
pythonbrew venv create graphite
@mschuetz
mschuetz / noise.sh
Created January 11, 2012 12:42
pink noise or space using sox
#!/bin/bash -e
function die() {
echo $1 >&2
exit 0
}
[[ -x $(which play) ]] || die "sox must be installed"
if [ $# -gt 0 ]; then
@ryanb
ryanb / index.js.erb
Created December 16, 2011 23:22
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end