-(BOOL)appIsPresentInLoginItems | |
{ | |
NSString *bundleID = @"blah"; | |
NSArray * jobDicts = nil; | |
jobDicts = (NSArray *)SMCopyAllJobDictionaries( kSMDomainUserLaunchd ); | |
if ( (jobDicts != nil) && [jobDicts count] > 0 ) { | |
BOOL bOnDemand = NO; | |
Web.Store = DS.Store.extend(); | |
DS.WebsocketAdapter = DS.RESTAdapter.extend({ | |
callbacks: {}, | |
socket: null, | |
beforeOpenQueue: [], | |
ajax: function(url, type, params) { | |
var adapter = this; | |
var uuid = adapter.generateUuid(); |
require 'action_dispatch/middleware/session/abstract_store' | |
require 'rack/session/abstract/id' | |
module ActionDispatch | |
module Session | |
class RedisStore < Rack::Session::Abstract::ID | |
include StaleSessionCheck | |
include Compatibility | |
attr_reader :server |
# docker build -t="rails" . | |
FROM ubuntu:12.04 | |
RUN apt-get update | |
## MYSQL | |
RUN apt-get install -y -q mysql-client libmysqlclient-dev | |
## RUBY |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# Makes any NSObject conform to the NSCoding protocol | |
# Authors: | |
# @rod_wilhelmy | |
# @cicloid | |
module Serializable | |
def attr_accessor_setters | |
methods.grep(/\w=:$/) | |
end |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
module StaticMapHelper | |
def static_map_for(location, options = {}) | |
params = { | |
:center => [location.lat, location.lng].join(","), | |
:zoom => 15, | |
:size => "300x300", | |
:markers => [location.lat, location.lng].join(","), | |
:sensor => true | |
}.merge(options) |
If you want to use curl or net-http/open-uri to access https resources, you will often (always?) get an error, because they don't have the large number of root certificates installed that web browsers have.
You can manually install the root certs, but first you have to get them from somewhere. This article gives a nice description of how to do that. The source of the cert files it points to is hosted by the curl project, who kindly provide it in the .pem format.
problem: Sadly, ironically, and comically, it's not possible to access that file via https! Luckily, the awesome curl project does provide us with the script that they use to produce the file, so we can do it securely ourselves. Here's how.
git clone https://github.com/bagder/curl.git
cd curl/lib
- edit
mk-ca-bundle.pl
and change: