Skip to content

Instantly share code, notes, and snippets.

View gAmUssA's full-sized avatar
so hard

Viktor Gamov gAmUssA

so hard
View GitHub Profile
@gAmUssA
gAmUssA / Open iterm tab here
Last active October 28, 2023 19:40 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder.To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
-- Modified to work with iTerm 2 night builds https://iterm2.com/applescript.html
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
@gAmUssA
gAmUssA / install_enterprise_jars.sh
Last active August 29, 2015 14:23
Install Hazelcast Enterprise Jars to local repo
#!/bin/sh
version=3.5
releaseRepo=https://repository-hazelcast-l337.forge.cloudbees.com/release/com/hazelcast
snapshotRepo=https://repository-hazelcast-l337.forge.cloudbees.com/snapshot/com/hazelcast
groupId="com.hazelcast"
artifactId="hazelcast-enterprise"
clientArtifactId="hazelcast-enterprise-client"
# install Hazelcast Enterprise
@gAmUssA
gAmUssA / jsr223Factories.groovy
Last active August 29, 2015 14:19
List All Scripting Engine Factories with JavaScript
import javax.script.ScriptEngine
import javax.script.ScriptEngineFactory
import javax.script.ScriptEngineManager;
//System.properties.each { k, v -> println("$k = $v") }
println System.properties['java.runtime.version']
println "---------------------------------"
ScriptEngineManager manager = new ScriptEngineManager()
ScriptEngine nashorn = manager.getEngineByName("nashorn")
if (nashorn != null) {
@gAmUssA
gAmUssA / jdk8.png
Last active August 29, 2015 14:17
idea 14.1
1
@gAmUssA
gAmUssA / gist:bb306eb5dd97af653900
Created January 18, 2015 17:14
WebSocket client
var ws;
if (window.WebSocket) {
    console.log("WebSocket supported in your browser");
    ws = new WebSocket("ws://localhost:8081");
    // Set event handlers.
    ws.onopen = function () {
        console.log("onopen");
    };
    ws.onmessage = function (e) {
        // e.data contains received string.
@gAmUssA
gAmUssA / HelloWorld.java
Created January 15, 2015 18:50
Groovy application context
ApplicationContext applicationContext =
new GenericGroovyApplicationContext("classpath:config/appConfig.groovy");
@gAmUssA
gAmUssA / appConfig.groovy
Created January 15, 2015 18:49
Groovy configuration for sping
package config
import com.farata.course.mwd.auction.data.DataEngine
import com.farata.course.mwd.auction.service.ProductService
beans {
xmlns([context: 'http://www.springframework.org/schema/context'])
context.'property-placeholder'(location: 'classpath:app.properties')
context.'component-scan'('base-package': "com.farata.course.mwd")
@gAmUssA
gAmUssA / gradle_karma
Created September 17, 2014 16:00
Executing Karma from gradle build
task karma(type: Exec){
workingDir "${project.webAppDirName}"
executable 'karma'
args 'start', '--single-run', 'true'
}
test {
doLast{
tasks.karma.execute()
}
runTest
"java.lang.AssertionError: Failed executing test test/script/basic/JDK-8048079_2.js
at jdk.nashorn.internal.test.framework.ScriptRunnable.runTest(ScriptRunnable.java:76)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)

Keybase proof

I hereby claim:

  • I am gamussa on github.
  • I am gamussa (https://keybase.io/gamussa) on keybase.
  • I have a public key whose fingerprint is 1B76 A73D 0DCA 3B8F B09A 2027 EFC7 C238 C9E7 FE3C

To claim this, I am signing this object: