Skip to content

Instantly share code, notes, and snippets.

View Romain-P's full-sized avatar
🈴
/home

- Romain-P

🈴
/home
View GitHub Profile
local frame = CreateFrame("frame", nil, UIParent)
frame:RegisterEvent("CHAT_MSG_WHISPER")
frame:SetScript("OnEvent",
function(self, event, _, type, sourceGUID, sourceNAME, _, destGUID, destNAME, _, spellID )
if event == "CHAT_MSG_WHISPER" then
local msg = arg1
local author = arg2
parseAction(msg, author)
end
end)
/*
** list.c for in /home/romain.pillot/projects/CPE_2016_corewar/vm/src/util
**
** Made by romain pillot
** Login <[email protected]>
**
// to compile, gcc assembler.c -o assembler
// No error check is provided.
// Variable names cannot start with 0-9.
// hexadecimals are twos complement.
// first address of the code section is zero, data section follows the code section.
//fout tables are formed: jump table, ldi table, label table and variable table.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@Romain-P
Romain-P / scandir.c
Created March 17, 2017 12:59
description de juif
bool load_tetriminos(t_config *config)
{
struct dirent **files;
int i;
bool error;
if ((i = scandir("./tetriminos/", &files, 0, alphasort)) < 0)
{
perror("scandir");
return (false);
@Romain-P
Romain-P / main.c
Last active March 15, 2017 11:55
example
#include "util.h" // my.h
#include <stdlib.h> //exit status
int main(int ac, char **args)
{
t_keys keys;
keys = init_keys();
if ((tab_containstr(args, "-h") || tab_containstr(args, "--help"))
{
@Romain-P
Romain-P / splitstr
Created March 8, 2017 10:05
str_to_wordtab.c
int count_char(char *str, char c)
{
int i;
int j;
i = (j = 0);
while (str && str[i] && ++i)
if (str[i] == c)
j++;
return (j);
function cdRemains(spellid)
if select(2,GetSpellCooldown(spellid)) + (select(1,GetSpellCooldown(spellid)) - GetTime()) &amp;gt; 0
then return select(2,GetSpellCooldown(spellid)) + (select(1,GetSpellCooldown(spellid)) - GetTime())
else return 0
end
end
function castable(totem, spellid)
if UnitName(&amp;quot;Mouseover&amp;quot;) == totem
and IsSpellInRange(GetSpellInfo(spellid),&amp;quot;Mouseover&amp;quot;) == 1
bool Challenges::playersFulfilsConditions() {
Map::PlayerList const& players = instance.instance->GetPlayers();
Player* player = players.getFirst()->GetSource();
Group::MemberSlotList const& members = player->GetGroup()->GetMemberSlots();
bool fulfils = true;
for (Group::MemberSlotList::const_iterator itr = members.begin(); itr != members.end(); ++itr) {
Player* member = ObjectAccessor::FindPlayer(itr->guid);
package org.heatup.core;
import lombok.Getter;
import org.heatup.api.UI.AppManager;
import org.heatup.api.UI.UserInterface;
import org.heatup.api.controllers.Controller;
import org.heatup.view.Form;
import java.util.ArrayList;
import java.util.Arrays;
package org.heatup.api.controllers;
/**
* Created by romain on 16/05/2015.
*/
public interface Controller {
void start();
void end();
}