Skip to content

Instantly share code, notes, and snippets.

View volgar1x's full-sized avatar

Antoine Chauvin volgar1x

View GitHub Profile
@volgar1x
volgar1x / gist:3217932
Created July 31, 2012 15:42
essai d'une action d'objet utilisable en Ruby
import org.shivas.data.entity.ItemTemplate
import org.shivas.data.entity.ItemAction
import org.shivas.server.database.model.Player
import org.shivas.protocol.formatters.ItemGameMessageFormatter
class GiveItemAction < ItemAction
TYPE = 4
def self.make(parameters, datas)
raw = parameters.get("item")
@volgar1x
volgar1x / gist:3218021
Created July 31, 2012 15:56
essai d'une commande en Ruby
import org.shivas.server.core.commands.Command
import org.shivas.server.core.commands.types.PlayerType
import org.shivas.common.params.Conditions
import org.shivas.common.params.Types
class GiveKamasCommand < Command
def name
"give_kamas"
end
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{{ server_name }} | {% block title %}{% endblock %}</title>
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
<link type="text/css" href="{{ asset('css/ui-lightness/jquery-ui-1.8.21.custom.css') }}" rel="stylesheet" />
{% block stylesheets %}{% endblock %}
<div class="content">
<div class="title">
{% block content_title %}
{% endblock %}
</div>
<div class="body">
{% block content_body %}
{% endblock %}
</div>
{% extends "::base.html.twig" %}
{% block title %}
{{ 'pages.admin_index.title'|trans }}
{% endblock %}
{% block content %}
<table>
<thead>
<tr>
{% extends "::base.html.twig" %}
{% block title %}
Les news
{% endblock %}
{% block body %}
{% for news in news_list %}
{% embed "::content.html.twig" %}
{% block content_title news.title %}
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"strings"
)
public static void println(String string, int radix) {
byte[] bytes = string.getBytes();
for (byte b : bytes) {
System.out.print(Integer.toString(b, radix));
}
System.out.println();
}
public static void printlnBinary(String string) {
println(string, 2);
package org.shivas.server.database.models;
import org.javalite.activejdbc.Model;
import org.javalite.activejdbc.LazyList;
public class Account extends Model {
public String getName() {
return getString("name");
}
package fr.blackrush.activejdbc;
import java.util.*;
public class App {
static String capitalize(String s) {
return Character.toUpperCase(s.charAt(0)) + s.substring(1);
}
static class Pair<T> {