For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2 gem errors on MacOS Mojave.
Make sure openssl is installed on Mac via Homebrew.
For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2 gem errors on MacOS Mojave.
Make sure openssl is installed on Mac via Homebrew.
Copy and paste the swift code below into a playground to experiment.
This is a very close emulation of Functor and Monad typeclasses in swift. However, it is very fragile (i.e. easy to crash the compiler).
For example, instance methods of fmap will run fine, but attempting to use a globally defined fmap that acts on Functor types will cause a crash. Similarly for bind. Unfortunately this means we cannot define the nice infix operator versions of these functions.
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| =begin | |
| github_toc v0.2.0 | |
| Brett Terpstra 2014 | |
| <http://brettterpstra.com/2014/07/01/github-toc-service/> | |
| Creates a linked table of contents from headers in a GitHub readme | |
| Place a [toc] marker in the file to have it automatically replaced with the TOC |
Dashing widget to show number of calls in Queue for a Broadworks call center. This widget uses the default dashing meter widget.
This widget uses the XSI interface defined by the XSI Schema for your Broadworks deployment.
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |
| if [ -f "$rvm_path/scripts/rvm" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| if [ -f ".rvmrc" ]; then | |
| source ".rvmrc" | |
| fi | |
| if [ -f ".ruby-version" ]; then | |
| rvm use `cat .ruby-version` | |
| fi |
| // | |
| // ExampleDelegate.h | |
| // Example | |
| // | |
| // Created by Scott Robertson on 2/10/13. | |
| // Copyright (c) 2013 Scott Robertson. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
| self.viewController = [[JBViewController alloc] initWithNibName:@"JBViewController" bundle:nil]; | |
| self.window.rootViewController = self.viewController; | |
| // ADD THIS LINE: | |
| [self.window setTransform:CGAffineTransformMakeScale(0.81, 0.81)]; | |
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: carbon-cache | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: carbon-cache init script | |
| # Description: An init script for Graphite's carbon-cache daemon. | |
| ### END INIT INFO |
| require 'net/http' | |
| require 'xmlsimple' | |
| url = "http://www.user-agents.org/allagents.xml" | |
| xml_data = Net::HTTP.get_response(URI.parse(url)).body | |
| data = XmlSimple.xml_in(xml_data) | |
| agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")} | |
| agent_names = agents.collect {|agent| agent["String"].first} |