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
@janosgyerik
janosgyerik / crc.c
Created May 3, 2012
crc implementation in c++
View crc.c
#include <stdio.h>
#include <stdint.h>
#include <string.h>
void crc8PushByte(uint8_t *crc, uint8_t ch) {
uint8_t i;
*crc = *crc ^ ch;
for (i=0; i<8; i++) {
@janosgyerik
janosgyerik / download-coursera-lecture-notes.bash
Created Oct 8, 2013
Recipe to download all lecture notes of a course on Coursera
View download-coursera-lecture-notes.bash
# requirements: python, virtualenv, pip
#
# create a virtualenv -- I keep all my virtualenvs in ~/virtualenv
virtualenv --distribute ~/virtualenv/coursera
# activate virtualenv
. ~/virtualenv/coursera/bin/activate
# get the coursera downloader tool and install requirements
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)
You can’t perform that action at this time.