Skip to content

Instantly share code, notes, and snippets.

View 6qat's full-sized avatar

Guilherme Ceschiatti B. Moreira 6qat

View GitHub Profile
@6qat
6qat / intellij-idea-shortcuts.md
Created August 30, 2023 19:05 — forked from hopbit/intellij-idea-shortcuts.md
IntelliJ IDEA Keyboard Shortcuts Cheatsheet

Modes

distraction mode
fullscreen mode
autoscroll from/to source
termial settings -> don't override shortcuts presentation asist

Editing

@6qat
6qat / open.sh
Created August 6, 2020 15:42 — forked from dcsobral/open.sh
"open" for Bash on WSL in Windows
open ()
{
# The first argument to start needs to be empty to avoid issues when paths have spaces
cmd.exe /C start "" "$(wslpath -w "$1")"
}
@6qat
6qat / tcp_timeout.go
Created May 17, 2019 05:20 — forked from hongster/tcp_timeout.go
Golang example on handling TCP connection and setting timeout.
package main
import (
"fmt"
"net"
"time"
"bufio"
)
func handleConnection(conn net.Conn) {
import java.io.{File, FileInputStream}
import java.util
import monix.execution.Cancelable
import monix.reactive.Observable
import scala.util.control.NonFatal
def fromInputStream(in: java.io.InputStream, chunkSize: Int = 256): Observable[Array[Byte]] = {
val iterator = new Iterator[Array[Byte]] {
private[this] val buffer = new Array[Byte](chunkSize)
private[this] var lastCount = 0
@6qat
6qat / CombineLatest.scala
Created June 7, 2018 11:11 — forked from tg44/CombineLatest.scala
Quick implementation of the CombineLatest RX operator in AkkaStreams
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl.{Flow, GraphDSL, Keep, RunnableGraph, Sink, Source}
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler}
import akka.testkit.TestKit
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import scala.concurrent.Await
class CombineLatest[A, B]
@6qat
6qat / config.yml
Created July 15, 2017 13:39 — forked from charpeni/config.yml
CircleCI configuration for Angular CLI
version: 2
jobs:
build:
working_directory: ~/app-name
docker:
- image: circleci/node:6-browsers
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
@6qat
6qat / index.html
Created September 5, 2014 18:01
Creating Reusable Social Share Buttons // source http://jsbin.com/OMOgUzo/1
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Creating Reusable Social Share Buttons" />
<script src="http://code.jquery.com/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
/* Ismael Celis 2010
Simplified WebSocket events dispatcher (no channels, no users)
var socket = new FancyWebSocket();
// bind to server events
socket.bind('some_event', function(data){
alert(data.name + ' says: ' + data.message)
});
@6qat
6qat / gist:4118386
Created November 20, 2012 14:53
JavaScript: Check valid e-mail
function is_valid_email($email)
{
if(preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email) > 0)
return true;
else
return false;
}
@6qat
6qat / guiga.js
Created November 20, 2012 14:10
Starting using GistBox
function Person() {
this.name = jeff;
this.age = 27;
}
new Person();