Skip to content

Instantly share code, notes, and snippets.

Janos Gyerik janosgyerik

Block or report user

Report or block janosgyerik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test-markdown-gist.md

title

Lorem ipsum dolor sid amet.

section

Lorem ipsum dolor sid amet.

sub-section

View terraform-example.tf
provider "google" {
region = "${var.region}"
project = "${var.project_name}"
credentials = "${file("${var.credentials_file_path}")}"
}
resource "google_compute_instance" "docker" {
count = 1
View terraform-issues.md
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
View 732-my-calendar-3.java
// 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);
View Install & Configure SonarQube.md

Create Amazon EC2 Instance

  • Ensure that inbound MySQL port 3306 is opened
  • chmod 700 "keypair-name.pem"

Install MySQL

To install MySQL, run the following command from a terminal prompt:

  • sudo apt-get install mysql-server
View twitter-followers.R
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)
View stack.md

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();
}
View draft-watch-unwatch-2.md

Watch or unwatch GitHub repositories using GitHub API + curl + jq + Bash

When you need to perform an operation on a large number of GitHub repositories, their REST API and some command line magic comes in handy. This short talk will demonstrate a technique to watch and unwatch GitHub repositories using ad-hoc scripts. The example should give a good idea how to perform other bulk operations too.

Background...

I have this setting in my personal GitHub account:

You can’t perform that action at this time.