Skip to content

Instantly share code, notes, and snippets.

@protozoo
protozoo / 8fit_printable_weekmenu.js
Created April 26, 2016 10:21
A JS snippet to be run in Chrome's console to get a printable view of a week's menu
(function(){
// Instructions:
// --------------------------------------------------------------
// 1. Browse to the first day of the week you want to print
// (i.e. https://8fit.com/a/#/meals/date/2016-05-02)
// 2. Run this script in the console
// 3. Zoom-in/out as needed
// 4. Take screenshot and print
// ==============================================================
@adewes
adewes / README.md
Last active February 13, 2024 16:39
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@dcosson
dcosson / gist:3686437
Created September 9, 2012 18:52
Compile Vim on OSX (Mountain Lion)
# default vim on osx doesn't have python, ruby support or clipboard support. These configure options add all that
# I also ran into problems using rvm ruby, had to include those libs in the LDFLAGS for vim
# Steps:
$ rvm install 1.9.1
$ rvm use 1.9.1 # vim doesn't support anything higher
$ curl ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | tar xj
$ cd vim73
$ ./configure --with-features=huge --enable-perlinterp=yes --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-multibyte
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@micho
micho / nginx.conf
Last active September 29, 2023 16:38 — forked from unixcharles/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@francesc
francesc / utf8encode.rake
Created December 12, 2010 19:03
Manage the UTF-8 encoding header for ruby 1.9
desc "Manage the encoding header of Ruby files"
task :utf8_encode_headers => :environment do
files = Array.new
["*.rb", "*.rake"].each do |extension|
files.concat(Dir[ File.join(Dir.getwd.split(/\\/), "**", extension) ])
end
files.each do |file|
content = File.read(file)
next if content[0..16] == "# coding: UTF-8\n\n" ||
@ryanb
ryanb / github_tree_slider.js
Created December 6, 2010 17:23
This is how GitHub's new AJAX file browser works.
GitHub.TreeSlider = function () {
if (window.history && window.history.pushState) {
function a() {
if (e.sliding) {
e.sliding = false;
$(".frame-right").hide();
$(".frame-loading:visible").removeClass("frame-loading")
}
}
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
@mislav
mislav / gist:645208
Created October 25, 2010 16:06
TextMate command to copy a GitHub URL for selected code to clipboard
#!/usr/bin/env ruby
filename = ENV['TM_FILEPATH']
root_dir = ENV['TM_DIRECTORY']
root_dir = File.dirname(root_dir) until File.directory?("#{root_dir}/.git") or root_dir == "/"
Dir.chdir root_dir
file_path = filename.sub("#{root_dir}/", '')
if ENV['TM_INPUT_START_LINE']
require 'csv'
CSV.open("#{Rails.root}/../consumers.csv", "w") do |csv|
["Last login","Registration date","Organizations", "Projects count", "Organizations Plan", "name", "time_zone", "Language", "Email", "Phones", "Address"]
User.find_each(:include => [{:card => [:addresses, :phone_numbers]}, :organizations]) do |user|
print '.'
phones = []
if user.card
phones << user.card.phone_numbers.map(&:name).join(";") if user.card.phone_numbers
first_address = user.card.addresses.first
end