Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Thomas Parslow http://almostobsolete.net | |
| # Just a work in progress and adapted to what I need right now. | |
| # It does uploads (via a file-like object that you write to) and | |
| # I've started on downloads. Needs the development version of Boto from Github. | |
| # | |
| # Example: | |
| # | |
| # glacierconn = GlacierConnection(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) | |
| # writer = GlacierWriter(glacierconn, GLACIER_VAULT) | |
| # writer.write(somedata) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # = Capistrano Assets recipe | |
| # | |
| # Provides a couple of tasks for precompiling assets locally | |
| # Assumes usage of AssetSync to deploy to CloudProvider or CDN | |
| # | |
| # Inspired by http://www.rostamizadeh.net/blog/2012/04/14/precompiling-assets-locally-for-capistrano-deployment | |
| namespace :deploy do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Api::RegistrationsController < Api::BaseController | |
| respond_to :json | |
| def create | |
| user = User.new(params[:user]) | |
| if user.save | |
| render json: user.as_json(auth_token: user.authentication_token, email: user.email), status: :created | |
| return | |
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try: | |
| from xml.etree.cElementTree import XML | |
| except ImportError: | |
| from xml.etree.ElementTree import XML | |
| import zipfile | |
| """ | |
| Module that extract text from MS XML Word document (.docx). | |
| (Inspired by python-docx <https://github.com/mikemaccana/python-docx>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // url_to_drive.gs | |
| // Google Apps Script | |
| // Allows uploading a URL directly to Google Drive. | |
| // | |
| // Live link: | |
| // https://script.google.com/macros/s/AKfycbzvhbHS4hnWPVBDHjQzZHA0qWq0GR-6hY7TbYsNto6hZ0MeAFZt/exec | |
| // | |
| // Source-code: | |
| // https://gist.github.com/denilsonsa/8134679 | |
| // https://script.google.com/d/1Ye-OEn1bDPcmeKSe4gb0YSK83RPMc4sZJt79SRt-GRY653gm2qVUptoE/edit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The regex patterns in this gist are intended only to match web URLs -- http, | |
| https, and naked domains like "example.com". For a pattern that attempts to | |
| match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
| # Single-line version: | |
| (?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # crashplanFixup.sh for Macintosh OS X 10.9 (and probably earlier versions) | |
| # | |
| # This script will prevent CrashPlan from de-duplicating data on files greater than 1k. | |
| # Based on information from http://networkrockstar.ca/2013/09/speeding-up-crashplan-backups/ | |
| # | |
| # NOTE: Must be run with sudo! IE: $ sudo sh ./crashplanFixup | |
| # | |
| # v1.1 2014-03-13 by [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this scrubs emoji sequences from a string - i think it covers all of them | |
| def strip_emoji ( str ) | |
| str = str.force_encoding('utf-8').encode | |
| clean_text = "" | |
| # emoticons 1F601 - 1F64F | |
| regex = /[\u{1f600}-\u{1f64f}]/ | |
| clean_text = str.gsub regex, '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Financeiro | |
| # Inclui suporte para escrever em um campo com valor monetário | |
| # utilizando BigDecimal, ou valor em string seguindo sintaxe | |
| # do jQuery MoneyMask | |
| # | |
| # Para habilitar em um model é preciso primeiro fazer um include no model: | |
| # include MoneyAttribute | |
| # | |
| # Defina cada um dos campos que você quer que tenham o comportamento: |