Skip to content

Instantly share code, notes, and snippets.

View vinilios's full-sized avatar

Kostas Papadimitriou vinilios

  • GRNet
  • Athens, Greece
View GitHub Profile
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function withContextProps<P, C extends React.Context<any>>(
component: React.FC<P>,
context: C,
hook?: (a: React.ContextType<C>, b: P) => Partial<P>
): React.FC<P> {
type CP = React.ContextType<C>;
type UP = CP & P;
const commonHook = (ctx: CP | null, p: P): UP => {
return ctx ? { ...ctx, ...p } : (p as UP);
@vinilios
vinilios / install xapian inside virtualenv
Created October 1, 2009 14:53
xapian local installation
apt-get install zlib1g-dev
apt-get install g++
export VENV=$VIRTUAL_ENV
mkdir $VENV/packages && cd $VENV/packages
curl -O http://oligarchy.co.uk/xapian/1.0.16/xapian-core-1.0.16.tar.gz
curl -O http://oligarchy.co.uk/xapian/1.0.16/xapian-bindings-1.0.16.tar.gz
tar xzvf xapian-core-1.0.16.tar.gz
@vinilios
vinilios / controllers.application.js
Last active October 12, 2016 13:16
ember sorting
import Ember from 'ember';
let MODEL = Ember.A([
Ember.Object.create({value: 1}),
Ember.Object.create({value: 2}),
Ember.Object.create({value: 3}),
Ember.Object.create({value: 4})
]);
export default Ember.Controller.extend({
@vinilios
vinilios / controllers.application.js
Created October 3, 2016 16:20
strange-cp-updates
import Ember from 'ember';
const {
set, get, on, computed
} = Ember;
const MyClass = Ember.Object.extend({
fullname: computed('profile', 'profile.name', 'profile.surname', function() {
console.log("resolve fullname");
@vinilios
vinilios / update linker, compiler.... etc paths
Created December 7, 2009 23:56
update linker, compiler.... etc paths
#!/bin/bash
LIB_NAME=mylib
LIB_PREFIX=~/opt/mylib-0.1
export DYLD_LIBRARY_PATH=$LIB_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LIB_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$LIB_PREFIX/include
export ACLOCAL_PATH=$LIB_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$LIB_PREFIX/lib/pkgconfig
PATH=$LIB_PREFIX/bin:$PATH
PS1="[custom lib shell] \w @ "
@vinilios
vinilios / components.my-but.js
Last active August 5, 2016 07:35
test-focus-invalidation
import Ember from 'ember';
export default Ember.Component.extend({
init: function() {
this._super();
console.log("lala");
},
tagName: 'button',
classNameBindings: ['focused:focus'],
click: function(event) {
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@vinilios
vinilios / gist:1884440
Created February 22, 2012 11:42
pithos-sh create fix
diff --git snf-pithos-tools/pithos/tools/sh.py snf-pithos-tools/pithos/tools/sh.py
index f0ae12c..8dac56a 100755
--- snf-pithos-tools/pithos/tools/sh.py
+++ snf-pithos-tools/pithos/tools/sh.py
@@ -225,12 +225,12 @@ class Meta(Command):
class CreateContainer(Command):
syntax = '<container> [key=val] [...]'
description = 'create a container'
- policy={}
+ policy={'versioning':'', 'quota':''}
#Shell script for KDE launching CopperCore
DIRNAME=`dirname $0`
DIRNAME=`cd $DIRNAME; pwd`
PROGNAME=`basename $0`
# Add the CopperCore.properties to the class path
JBOSS_CLASSPATH="$DIRNAME:"
export JBOSS_CLASSPATH
@vinilios
vinilios / default mysql storage engine for the current session
Created March 8, 2010 00:46
default mysql storage engine for the current session
SET storage_engine=MYISAM;