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
package com.hiya.h4b.cpas.futuretest | |
import akka.actor.ActorSystem | |
import scala.concurrent.{Await, Future} | |
import scala.concurrent.duration._ | |
object FutureTestApp extends App { | |
private val sys = ActorSystem.apply("future-test-app") | |
implicit private val ec = sys.dispatcher |
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
require 'base64' | |
require 'cgi' | |
require 'openssl' | |
base = 'POST&https%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.json&include_entities%3Dtrue%26oauth_consumer_key%3Dxvz1evFS4wEEPTGEFPHBog%26oauth_nonce%3DkYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1318622958%26oauth_token%3D370773112-GmHxMAgYyLbNEtIKZeRNFsMKPR9EyMZeS9weJAEb%26oauth_version%3D1.0%26status%3DHello%2520Ladies%2520%252B%2520Gentlemen%252C%2520a%2520signed%2520OAuth%2520request%2521' | |
key = 'kAcSOqF21Fu85e7zjz7ZN2U4ZRhfV3WpwPAoE3Z7kBw&LswwdoUaIvS8ltyTt5jkRh4J50vUPVVHtR2YPi5kE' | |
puts CGI.escape(Base64.encode64("#{OpenSSL::HMAC.digest('sha1', key, base)}\n")) |
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
#define true false //happy debugging motherfuckers :)))) |
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
package com.hunorkovacs.catsi | |
import cats.effect.Sync | |
import cats.Applicative | |
import org.log4s.{getLogger, Logger => Log4sLogger} | |
trait Logger[F[_]] { | |
def trace(str: String): F[Unit] |
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
# Appends a new line with a - to every frame of movie subtitles to shift | |
# the overall position up when the tv cuts down the bottom. | |
# | |
# ruby subtitles-shift-up.rb Titanic.srt | |
# or | |
# ruby subtitles-shift-up.rb Titanic.srt UTF-8 | |
# | |
# result: Titanic-shifted.srt | |
def addEmptyLine(inFile, outFile) |
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
{ | |
"name": "MyClass", | |
"type": "record", | |
"namespace": "", | |
"fields": [ | |
{ | |
"name": "name", | |
"namespace": "name", | |
"type": "string" | |
} |
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
Don't let me Google that for you | |
Just ctrl-f this file | |
# The Git reference: | |
git checkout --help | |
# Pushing | |
# Recommended pushing method | |
git push <remote> sourceBranch | |
git push origin master |
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
implicit val awsConfigReader: ConfigReader[AWSConfig] = ConfigReader.fromCursor[AWSConfig] { cur => | |
for { | |
objCur <- cur.asObjectCursor | |
maxConnections <- objCur.atKey("max-connections") | |
maxConnectionsInt <- maxConnections.asInt | |
maxErrorRetry <- objCur.atKey("max-error-retry") | |
maxErrorRetryInt <- maxErrorRetry.asInt | |
endpoint <- objCur.atKey("endpoint") | |
endpointStr <- endpoint.asString | |
region <- objCur.atKey("region") |
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
package com.hiya.h4b.cpas.service | |
import java.time.Instant | |
import java.time.Instant.now | |
import akka.http.scaladsl.model.StatusCode | |
import akka.http.scaladsl.model.StatusCodes.{Created, NotFound, OK} | |
object Typeclasses extends App { |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"os" | |
"time" | |
"golang.org/x/crypto/scrypt" | |
) |
NewerOlder