Skip to content

Instantly share code, notes, and snippets.

View mariuz's full-sized avatar

Popa Marius Adrian mariuz

View GitHub Profile
@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
@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;
@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);
@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
@roboshoes
roboshoes / Spherical.cs
Last active November 22, 2017 22:29
Implementation of spherical coordinates in C# (based on https://github.com/mrdoob/three.js/blob/master/src/math/Spherical.js)
using UnityEngine;
public struct Spherical {
public float Radius;
public float Phi;
public float Theta;
Spherical( float radius = 1f, float phi = 0f, float theta = 0f ) {
Radius = radius;
@berk76
berk76 / com_exe.md
Last active February 9, 2018 15:07
DOS: com vs exe

COM vs. EXE Program

EXE program can have any size whereas COM program can have maximally 64kB (just one segment).

COM Program

At the beginning of program there is program segment prefix (PSP). Because COM program is stored only in one segment so PSP occupies first 256 bytes (100h). Therefore start point begins at 100h. Values of segment registers are set to the begin of segment and don’t change during executing.

COM program in memory:

@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}"
@wojtha
wojtha / migrate_rubocop_style_to_layout.rb
Last active January 10, 2019 10:37
Ruby script to migrate Rubocop settings from Style to Layout
# Fixes complains such as:
# .rubocop.yml: Style/IndentationConsistency has the wrong namespace - should be Layout
# .rubocop.yml: Style/IndentationWidth has the wrong namespace - should be Layout
# .rubocop.yml: Style/DotPosition has the wrong namespace - should be Layout
layouts = %w[
AccessModifierIndentation
AlignArray
AlignHash
AlignParameters
@berk76
berk76 / c_asm.md
Last active April 2, 2020 20:45
DOS: TASM and C

How to combine Assembly and C in DOS

This gist is showing an example of C program calling routine written in assembly.

Some theory

  • C is case sensitive so it is necessary to use /ml switch in TASM
  • C compiler uses leading underscore (_) character for function names
  • parameters are passed to function in stack and integer return value is passed back in AX register
  • stack cleaning is done by caller