Skip to content

Instantly share code, notes, and snippets.

@laino
laino / .Xresources
Created February 13, 2012 15:22
Zenburn i3 config.vi
! xscreensaver ---------------------------------------------------------------
!font settings
xscreensaver.Dialog.headingFont: -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.bodyFont: -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.labelFont: -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.unameFont: -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.buttonFont: -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.dateFont: -*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.passwd.passwdFont: -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
URxvt*depth: 32
URxvt*background: rgba:0000/0000/0000/aE20
!URxvt*transparent: true
!URxvt*shading: 30
! --- special colors ---
!*background: #0d1926
*foreground: #d9e6f2
@laino
laino / gist:8848166
Created February 6, 2014 16:55
Node.js strace
futex(0xcc1140, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(5, {{EPOLLIN, {u32=42, u64=42}}, {EPOLLIN, {u32=43, u64=43}}, {EPOLLIN, {u32=8, u64=8}}}, 1024, 24) = 3
read(42, "\377\373P\304\357\200\nX;\21$\261$\301Z\f\342d\201\214\340\37~\303\20\231)*\240zc\276"..., 65536) = 625
read(43, "\377\373p\304\353\0\22\rw_\354<\315\342&-l=\207\215\274\245\232\262@x\303O\337OH\232"..., 65536) = 626
read(8, "\1\0\0\0\0\0\0\0", 1024) = 8
futex(0xcc1184, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0xcc1180, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0xcc1140, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0xcc1184, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0xcc1180, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0xcc1140, FUTEX_WAKE_PRIVATE, 1) = 1
epoll_wait(5, {{EPOLLIN, {u32=42, u64=42}}, {EPOLLIN, {u32=43, u64=43}}, {EPOLLIN, {u32=8, u64=8}}, {EPOLLIN, {u32=51, u64=51}}, {EPOLLIN, {u32=35, u64=35}}}, 1024, 23) = 5
@laino
laino / After rewrite to DesignToJs.js
Last active August 29, 2015 14:05
Design.js rewrite of Node.js Module
var redis = require('../redis.js');
var filelist = require('../redis/filelist.js');
var jsonList = require('../redis/jsonList.js');
var keygen = require('../util/keygen.js');
var live = require('./live/room.js');
getRoomExpiration: (){
var expiration = redis.config.room_expiration_days * 24 * 60 * 60;
if(expiration < 24 * 60 * 60){
@laino
laino / room.js
Created August 16, 2014 21:48
Original Module File
var redis = require('../redis.js');
var filelist = require('../redis/filelist.js');
var jsonList = require('../redis/jsonList.js');
var keygen = require('../util/keygen.js');
var live = require('./live/room.js');
function getRoomExpiration(){
var expiration = redis.config.room_expiration_days * 24 * 60 * 60;
if(expiration < 24 * 60 * 60){
throw "Safety check failed, expiration less than one day!";
@laino
laino / fstream_index.js
Created September 26, 2014 11:47
Faster streaming
'use strict';
var events = require('events');
var util = require('util');
var fs = require('fs');
var BUFF_SIZE = 32 * 1024;
var BUFF_MAX = 256 * 1024;
var BUFF_GROW = 32 * 1024;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 98cfa2e..3934469 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -661,7 +661,10 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
* In Counter-Strike: Source a frame difference of 3 causes noticable
* input delay that makes the game unplayable. */
while (pending > 1)
+ {
+ usleep(0);
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 7731a82..301e395 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -662,7 +662,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
* In Counter-Strike: Source a frame difference of 3 causes noticable
* input delay that makes the game unplayable. */
while (pending > 1)
+ {
+ wined3d_cs_mt_yield();
@laino
laino / wined3d_csmt_fix_return.diff
Last active August 5, 2016 17:19
Wine CSMT patches
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 44d5f8a..c7c80c6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2495,7 +2495,10 @@ static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
TRACE("Adding new light\n");
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
- return E_OUTOFMEMORY;
+ {
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 505661d..a099c33 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -642,6 +642,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
unsigned int i;
#if defined(STAGING_CSMT)
LONG pending;
+ LARGE_INTEGER spin_start;
+ spin_start.QuadPart = 0;