Skip to content

Instantly share code, notes, and snippets.

View hron84's full-sized avatar
🔫
Hunting bugs

Gabor Garami hron84

🔫
Hunting bugs
View GitHub Profile
@hron84
hron84 / happy.c
Last active July 31, 2018 10:00 — forked from neoeno/sad.c
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
const char* RESET = "\x1B[0m";
const char *COLORS[] = { "\x1B[31m", "\x1B[32m", "\x1B[33m", "\x1B[34m", "\x1B[35m", "\x1B[36m" };
int main() {
@hron84
hron84 / lotto.c
Last active October 24, 2016 09:19 — forked from fejesjoco/lotto.c
/*
* Feladat:
* Irjon C programot az otoslotto nyeroszamainak veletlenszeru eloallitasara!
* Ugyeljen, hogy ne ismetlodjenek a szamok!
*
* Megoldas:
* Legeneralunk a "szamok" tombbe egy szamsort 1-90-ig (lehetseges nyeroszamok),
* Ezekbol kihuzunk egy szamot, amit beirunk a "nyeroszamok" tombbe,
* A kihuzott szamot a "szamok" tombben kicsereljuk az utolso elemmel,
* Legkozelebb a "szamok" tomb elsotol utolso elotti elemeig valasztunk nyeroszamot,
$('#nextmonth').on('click', fuction(e)) {
$.get('/rota_days/show.json?mon=12').success(function(data) {
rota_days = data
for ( i = 0; i < rota_days.length; i++)
{
rota_day = rota_days[0];
/* doing stuffs with rota_day */
}
module ApplicationHelper
def b(value, options = {})
options = {
:true => :positive,
:false => :negative,
:scope => [:boolean],
:locale => I18n.locale, # <- It makes easy to avoid conditional run
}.merge options
# avoid passing nil, or some desctructive value
@hron84
hron84 / haml2erb
Created March 6, 2011 23:42 — forked from jzajpt/haml2erb
haml2erb
#!/usr/bin/ruby
require 'rubygems'
require 'haml'
class ErbEngine < Haml::Engine
def push_script(text, opts = {} )
push_text "<%= #{text.strip} %>"
end