google_compute_instance.docker[0]: Creating...
google_compute_instance.docker[0]: Still creating... [10s elapsed]
google_compute_instance.docker[0]: Still creating... [20s elapsed]
google_compute_instance.docker[0]: Provisioning with 'remote-exec'...
Error: Failed to parse ssh private key: ssh: cannot decode encrypted private keys
This file contains 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
provider "google" { | |
region = "${var.region}" | |
project = "${var.project_name}" | |
credentials = "${file("${var.credentials_file_path}")}" | |
} | |
resource "google_compute_instance" "docker" { | |
count = 1 |
This file contains 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
// solution to: 732. My Calendar III https://leetcode.com/problems/my-calendar-iii/ | |
class MyCalendarThree { | |
private final Comparator<Pos> comparator = Comparator.<Pos>comparingInt(p -> p.pos) | |
.thenComparing((p1, p2) -> { | |
if (p1.mark == p2.mark) return Integer.compare(p1.hashCode(), p2.hashCode()); | |
if (p1.mark == Mark.END) return -1; | |
return 1; | |
}); | |
private final SortedSet<Pos> marks = new TreeSet<>(comparator); |
This file contains 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
library(rtweet) | |
D <- c() | |
for(u in c("OneNaziq", "AzimRidzuan_", "pais_10")) { | |
D <- rbind(D, get_followers(u, n= "all", page = "-1", parse = TRUE, as_double = FALSE, token = NULL)) | |
} | |
nrow(D) |
- Works even under the most spartan conditions (in a simple remote shell window such as xterm, putty), with syntax highlighting, function folding, tabs, buffers, and all that lightning fast
- Delete lines matching pattern:
g/pattern/d
- Delete lines not matching pattern:
g!/pattern/d
- Sort buffer:
:%sort
- Filter buffer through command
:%!sort -u
- Delete from current line until end of file (try with a large file!)
- Increment numeric values:
C-a
,C-x
- Complete line pattern
C-x C-l
- Convert a DOS file (with CRLF line endings) to UNIX:
:set ff=unix
(and then save it)
Java:
@POST
@Path("/post")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response createPost(@FormParam("type") String type, @FormParam("content") String content) {
postEJB.createPostUserRest(type, content);
URI userURI = uriInfo.getAbsolutePathBuilder().build();
return Response.created(userURI).build();
}
This file contains 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
#!/usr/bin/env python | |
# | |
# Notes: | |
# | |
# - python API home: | |
# https://github.com/mLewisLogic/foursquare | |
# | |
# - foursquare API home: | |
# https://developer.foursquare.com/ | |
# |
This file contains 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/sh | |
# 1. Create symlinks to the real upgrade scripts for each branch, for example: | |
# ./upgrade-beta.sh # will only be called when "beta" branch is updated | |
# ./upgrade-prod.sh # will only be called when "prod" branch is updated | |
# | |
# 2. Put these symlinks in the repository root, NOT in the hooks/ directory | |
# the post-receive hook receives parameters on stdin | |
while read oldrev newrev refname |