Skip to content

Instantly share code, notes, and snippets.

View georgy7's full-sized avatar

Георгий У. georgy7

View GitHub Profile
@maxsummers
maxsummers / ubuntu-install-zeromq.sh
Last active March 29, 2018 05:43
How to install ZeroMQ 4 on Ubuntu 16.10 from source
#!/usr/bin/env bash
# As in: http://stackoverflow.com/a/41289659/7331008
# Exiting on errors
set -e
# Set required version
VERSION="4.2.0"
@aqiank
aqiank / gist:efa6eefcc81157982acc
Last active March 9, 2019 15:43
SDL2 DropEvent minimal example
#include <SDL2/SDL.h>
int main() {
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window *window = SDL_CreateWindow("Drag-and-Drop", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN);
int running = 1;
while (running) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
@ruby0x1
ruby0x1 / haxe-unzip-example.hx
Created June 7, 2014 19:36
Unzip a file with haxe - example
public static function unzip( _path:String, _dest:String, ignoreRootFolder:String = "" ) {
var _in_file = sys.io.File.read( _path );
var _entries = haxe.zip.Reader.readZip( _in_file );
_in_file.close();
for(_entry in _entries) {
var fileName = _entry.fileName;
@hunterhector
hunterhector / emoticons
Last active November 9, 2022 04:18 — forked from Digo/emoticons
I used these emoticons to decorate my bash via this script: https://gist.github.com/hunterhector/e8befc2d0bfe636bee56
(´・ω・`)
(˘❥˘)
(・ิω・ิ)
(。▰‿‿▰。) ❤
( ・ิω・ิ)ノิ
Z(∩3∩)Z
o( ̄ヘ ̄o#).
╰(*°▽°*)╯
ʅ(‾◡◝)ʃ
ʕ •ᴥ•ʔ
@anunyin
anunyin / gist:6604014
Last active January 22, 2019 15:53
SDL 2: Changing Resolution at Runtime
// windowHandle is a pointer to an SDL_Window object, acquired and stored from your original call to SDL_CreateWindow
SDL_DestroyWindow(windowHandle);
// You'll probably want to keep the window title and window position unchanged
// by caching those values before you destroy the previous window.
windowHandle = SDL_CreateWindow("Window Title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, newWidth, newHeight, SDL_WINDOW_OPENGL);
// windowContext is an SDL_GLContext object, acquired and stored from your initial SDL_GL_CreateContext call.
SDL_GL_MakeCurrent(windowHandle, windowContext);
// Again, keeping in mind that resolution and window size are separate things --
@andyli
andyli / AbstractClass.hx
Last active June 24, 2021 13:40
Java abstract class implemented in Haxe macros. Related: https://groups.google.com/forum/?fromgroups=#!topic/haxelang/WzeI-N1XbIg
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
using Lambda;
/**
Old school abstract class.
Classes that implements it, and their sub-classes, will be able to declare abstract methods (methods that without body).
There will be a check in compile-time such that no public constructor is allowed without all abstract methods implemented.
*/
@teabot
teabot / xa-datasources-spring.xml
Last active September 15, 2017 05:48
Example distributed XA transaction configuration for: Bitronix BTM, Spring, Hibernate, IBatis, Last Resource Commit
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util
@Integralist
Integralist / web-server.rb
Created June 3, 2012 10:16
Create basic Web Server in Ruby (using WEBrick)
#!/usr/bin/env ruby
require "webrick"
=begin
WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby.
It comes with most installations of Ruby by default (it’s part of the standard library),
so you can usually create a basic web/HTTP server with only several lines of code.
The following code creates a generic WEBrick server on the local machine on port 1234,
Gem::Specification.new do |s|
s.name = 'bang'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY
s.author = 'Jeff Kreeftmeijer'
s.email = 'jeff@kreeftmeijer.nl'
s.summary = 'Bang!'
s.description = 'Bangs existing model methods'
s.files = ['bang.rb']
@randrews
randrews / lua_map.c
Created April 23, 2011 22:16
Example of embedding Lua in C
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include <stdlib.h>
int map_create(lua_State *lua);
int map_slice(lua_State *lua);
int main(int argc, char **argv){
lua_State *lua = lua_open();