Skip to content

Instantly share code, notes, and snippets.

View mariuz's full-sized avatar

Popa Marius Adrian mariuz

View GitHub Profile
@asfernandes
asfernandes / FbEventsTest.cpp
Created March 26, 2011 20:55
Firebird events test using boost.
#include "ibase.h"
#include <string>
#include <boost/thread.hpp>
#define BOOST_TEST_MODULE LegacyTests
#include <boost/test/included/unit_test.hpp>
using std::string;
using boost::thread;
@valotas
valotas / tomcat.sh
Created May 31, 2011 07:11
Tomcat init.d script
#!/bin/bash
#
# tomcat7 This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
@xdenser
xdenser / node-firebird-libfbclient.js
Created June 1, 2012 19:36
node-firebird vs node-firebird-libfbclient
var cfg = require("./config").cfg;
var fb = require('../node_firebird/firebird');
var util = require('util');
var events = require('events');
var http = require('http');
var con = fb.createConnection();
con.connectSync(cfg.db, cfg.user, cfg.password, cfg.role);
@unak
unak / history.txt
Last active November 29, 2021 01:40
The History of Ruby
* Only the releases of the stable versions are listed in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also listed. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release because of an accident.
* 1.2.1 release was canceled once, and the 2nd release called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities, the mi
@zeroSteiner
zeroSteiner / firebird_dos.py
Last active December 14, 2015 13:29
Firebird Denial of Service Proof of Concept
#!/usr/bin/env python
"""
firebird_dos.py
Discovered: 1-31-2013
By: Spencer McIntyre (zeroSteiner)
SecureState Research and Innovation Team
www.securestate.com
@toobulkeh
toobulkeh / deploy.rb
Created January 2, 2014 02:42 — forked from benedikt/rails.rb
Updated for Capistrano 3.
# encoding: UTF-8
# Place in config/deploy.rb
namespace :rails do
desc "Open the rails console on each of the remote servers"
task :console do
on roles(:app) do |host| #does it for each host, bad.
rails_env = fetch(:stage)
execute_interactively "ruby #{current_path}/script/rails console #{rails_env}"
@joost
joost / deploy.rb
Last active October 10, 2018 09:12 — forked from toobulkeh/deploy.rb
Capistrano 3 rails console tasks
# encoding: UTF-8
# Place in config/deploy.rb
# See: https://gist.github.com/joost/9343156
# Adapted to work with rbenv
namespace :rails do
desc "Open the rails console on primary app server"
task :console do
on roles(:app), primary: true do
rails_env = fetch(:stage)
execute_interactively "#{bundle_cmd} #{current_path}/script/rails console #{rails_env}"
@ik5
ik5 / firebird.vim
Created June 13, 2014 19:53
Firebird SQL syntax for VIM - http://pastebin.com/DNag96VC
" Vim syntax file
" Language: SQL
" Maintainer: Scott Morgan < blumf7 at gmail dot com >
" Last Change: 2014-06-13
" Version: 1.0
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
@rzane
rzane / ar_fb_4.1.8.txt
Created November 26, 2014 02:56
activerecord-fb-adapter failures with activerecord 4.1.8
Finished in 528.247378s, 8.6153 runs/s, 21.9916 assertions/s.
1) Failure:
ActiveRecord::Migration::ColumnsTest#test_change_column [/home/ray/Workspace/fb_adapter/rails/activerecord/test/cases/migration/columns_test.rb:202]:
Expected #<ActiveRecord::ConnectionAdapters::FbColumn:0x00000007f51d18 @firebird_type="INTEGER", @name="approved", @sql_type="INTEGER", @null=true, @limit=nil, @precision=nil, @scale=nil, @type=:integer, @default="1", @default_function=nil, @primary=nil, @coder=nil, @domain="BOOLEAN", @sub_type=0> to be nil or false
2) Error:
ActiveRecord::Migration::ColumnsTest#test_change_column_default:
ActiveRecord::StatementInvalid: Fb::Error: Invalid token
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward