Skip to content

Instantly share code, notes, and snippets.

View andyvl's full-sized avatar

Andreas Vlachos andyvl

  • Athens, Greece
View GitHub Profile
@andyvl
andyvl / #🚀 GitHub Copilot: A Persona-Based Approach.md
Created September 1, 2025 13:28 — forked from kasuken/#🚀 GitHub Copilot: A Persona-Based Approach.md
GitHub Copilot: A Persona-Based Approach - All my chat modes

In this gist, you can find all the VS Code chat modes I am using in my projects for the Persona based approach technique I created.

You will find an article about on my dev.to blog (dev.to/kasuken)

@andyvl
andyvl / m101j.5.js
Last active November 16, 2015 23:35
M101J - Homework 5
//5.1
db.posts.aggregate([{"$unwind": "$comments"}, {"$group":{"_id": "$comments.author", "num":{"$sum": 1}}}, {"$sort": {"num":-1}}, {"$limit": 1}])
//5.2
db.zips.aggregate([{$match: { $or: [{state: "CA"}, {state: "NY"}]}}, {$group: {_id: {city: "$city", state: "$state"}, pop: {$sum: "$pop"}}}, {$match: {pop: {$gt: 25000}}}, {$group: {_id: 0, avg_pop: {$avg: "$pop"}}}])
//5.3
db.grades.aggregate([
{$project:{"_id":{student_id : "$student_id", class_id : "$class_id"}, scores:1}},
{$unwind:"$scores"},
{$match:{"scores.type":{$in:["homework","exam"]}}},
{$group:{_id:{student_id:"$_id.student_id", class_id:"$_id.class_id"}, score:{$avg:"$scores.score"}}},
@andyvl
andyvl / BeanTransaction.java
Last active October 24, 2015 12:58
CMT for tests
package test;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import java.util.concurrent.Callable;
/**
* Created by andy on 22/10/2015.
*/
@andyvl
andyvl / DataSourceDefinition
Last active November 5, 2015 16:58
DataSourceDefinition and JMSConnectionFactoryDefinition with a JMS 2.0 sender
import javax.annotation.Resource;
import javax.annotation.sql.DataSourceDefinition;
import javax.annotation.sql.DataSourceDefinitions;
import javax.ejb.Singleton;
import javax.inject.Inject;
import javax.jms.*;
import javax.sql.DataSource;