Skip to content

Instantly share code, notes, and snippets.

View notmandatory's full-sized avatar

Steve Myers notmandatory

View GitHub Profile
@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active December 26, 2023 03:18
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@ahjohannessen
ahjohannessen / ScalaPBSerializer.scala
Last active October 10, 2015 06:53
Reflection based serializer for ScalaPB generated case classes.
import java.lang.reflect.Method
import java.util.concurrent.atomic.AtomicReference
import akka.actor.ExtendedActorSystem
import akka.serialization.Serializer
import com.trueaccord.scalapb.GeneratedMessage
import scala.annotation.tailrec
/**
* This Serializer serializes `com.trueaccord.scalapb.GeneratedMessage`s
*/
@milessabin
milessabin / gist:25b7b669b5a9ac051a71
Created June 5, 2015 14:32
A safe ADT+shapeless drop-in replacement for the unsafe standard Scala Enumeration ...
// An ADT+shapeless as a drop-in replacement for a standard Scala Enumeration.
//
// First the unsafe standard Scala Enumeration ...
//
object ScalaEnumDemo extends App {
// Example from scala.Enumeration scaladoc. Terse ...
object WeekDay extends Enumeration {
type WeekDay = Value
val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value
}
@devrandom
devrandom / test_atomic.kt
Created February 24, 2015 22:58
One transactions, two wallets
import org.junit.Before
import org.junit.Test
import kotlin.test.fail
import org.bitcoinj.core.Transaction
import org.bitcoinj.params.MainNetParams
import org.bitcoinj.core.NetworkParameters
import org.bitcoinj.core.ECKey
import org.bitcoinj.core.Address
import org.bitcoinj.testing.FakeTxBuilder
import org.bitcoinj.core.Coin
@rklaehn
rklaehn / Proxy.scala
Created January 31, 2015 16:29
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {
@kcwill2
kcwill2 / GuiActor.scala
Last active October 30, 2015 22:10
a future pinned to the JavaFx app thread
object JavaFXExecutionContext {
implicit val javaFxExecutionContext: ExecutionContext = ExecutionContext.fromExecutor(new Executor {
def execute(command: Runnable): Unit = {
Platform.runLater(command)
}
})
}
...
@mikehearn
mikehearn / AffinityExecutor.java
Last active November 18, 2020 09:26
Some code for JavaFX observable collections (maps and sets) which replicate changes between threads. From the open source, Apache licensed Lighthouse project. Check there for the latest code.
// Contact: hearn@vinumeris.com
package lighthouse.threading;
import com.google.common.util.concurrent.Uninterruptibles;
import javafx.application.Platform;
import lighthouse.protocol.LHUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@mucaho
mucaho / src.YOUR_CODE.scala
Created February 13, 2014 10:42
Akka Actors to be executed in Swing / JavaFX thread - based on Victor Klang's [Swing Actors](https://gist.github.com/viktorklang/2422443)
// After that we just create the GUI Actors with a Props with the correct dispatcher set:
val javaFxActor = context.actorOf(Props[JavaFxActor].withDispatcher("javafx-dispatcher"), "javaFxActor")
val swingActor = context.actorOf(Props[SwingActor].withDispatcher("swing-dispatcher"), "swingActor")
// Done! Now all messages processed by the new actor will be executed by the Swing/JavaFX Event Dispatch Thread, enjoy!
@bjornharrtell
bjornharrtell / proguard.cfg
Created August 9, 2012 20:58
Proguard config for akka including akka remote (tested with akka 2.0.2)
-dontwarn org.jboss.netty.logging.**
-dontwarn org.osgi.**
-dontwarn javax.servlet.**
-dontwarn org.jboss.netty.channel.socket.http.**
## Unsafe is there at runtime
-dontwarn sun.misc.Unsafe
-keep class sun.misc.Unsafe{
*;
}