Skip to content

Instantly share code, notes, and snippets.

View aVolpe's full-sized avatar
:electron:
Hacking

Arturo Volpe aVolpe

:electron:
Hacking
View GitHub Profile
@aslakknutsen
aslakknutsen / CustomerResourceClientTest.java
Created March 23, 2011 00:23
JAX-RS Arquillian TestCase with @ArquillianResource injection
@RunWith(Arquillian.class)
public class CustomerResourceClientTest
{
private static final String REST_PATH = "rest";
@Deployment(testable = false)
public static Archive<?> createDeployment()
{
return ShrinkWrap.create(WebArchive.class)
.addPackage(Customer.class.getPackage())
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 19, 2024 07:21
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@devgeeks
devgeeks / meta-data-config.md
Created November 23, 2012 00:00
BugHerd meta data configuration API

The BugHerd sidebar can be configured to override some of its default behaviour as well as display extra information in any tasks that you pass in from a configuration object called BugHerdConfig.

When setting up BugHerd for the first time, you probably already know you need to add the following code to your site:

  <script type="text/javascript">
    (function (d, t) {
      var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];
      bh.type = 'text/javascript';
      bh.src = '//www.bugherd.com/sidebarv2.js?apikey=YOUR-API-KEY-HERE';
@tapuo
tapuo / Vibration.boo
Created December 11, 2012 12:39
vibration for unity android
import UnityEngine
class Vibration(MonoBehaviour):
private viblator as AndroidJavaObject
def Start():
unityPlayer as AndroidJavaClass = AndroidJavaClass("com.unity3d.player.UnityPlayer")
currentActivity as AndroidJavaObject = unityPlayer.GetStatic[of AndroidJavaObject]("currentActivity")
viblator = currentActivity.Call[of AndroidJavaObject]("getSystemService","vibrator")
@cbandy
cbandy / alert.js
Last active August 17, 2020 15:22
Kettle Javascript Job Entry
try
{
// Something
}
catch (error)
{
var spoon = Packages.org.pentaho.di.core.gui.SpoonFactory.getInstance();
spoon.messageBox(
error.message, error.name,
true, Packages.org.pentaho.di.core.Const.INFO
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@terrehbyte
terrehbyte / UsefulUnityAssets.md
Last active March 28, 2024 22:35
Useful Open-Source Unity Assets

Useful Open-Source Unity Assets

This is a compilation of various open-source Unity plugins, codebases, or utility scripts that may aid in expediting the development process.

Art / Design Tools

ProbePolisher - Light Probe Editor - keijiro

"ProbePolisher is a Unity Editor plugin for editing light probes. It works both on Unity Basic (free) and Unity Pro."

Code
Releases

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 16, 2024 20:25
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux