Skip to content

Instantly share code, notes, and snippets.

View cra's full-sized avatar
🔥

Igor cra

🔥
View GitHub Profile
-- cfg_sp.lua
counter = {}
function kpress_count(binding, fn, args)
if counter.binding then
counter.binding = counter.binding + 1
else
counter.binding = 1
end
@cra
cra / gist:3370011
Created August 16, 2012 13:11
Notion kpress_count test
COUNTER_FILE = "/tmp/notion_counter"
function kpress_count(binding, fn, args)
local counter = {}
local inp = io.open(COUNTER_FILE)
if inp then
-- read
for line in inp:lines() do
local k, v = line:match '(%S+)%s+(%S+)%s'
@cra
cra / split_2d.cpp
Created September 18, 2012 13:52 — forked from aterga/split_2d.cpp
Simple 2d array split method
void GameOfLife::split()
{
// Strategy:
n_x_nodes_ = n_nodes_;
n_y_nodes_ = 1;
int workload_per_node = 0;
int zero_node_workload = 0;
if (n_nodes_ > 1) {
workload_per_node = int(field_->size_x() / n_nodes_) * (n_nodes_ / (n_nodes_ - 1));
@cra
cra / -
Created January 18, 2014 20:57
/opt/caroline/base/json.cc: In member function ‘base::Value* base::json::Parser::ParseImpl(const string&, off_t*) const’:
/opt/caroline/base/json.cc:225:3: error: ‘unique_ptr’ is not a member of ‘std’
std::unique_ptr<Value> value;
^
/opt/caroline/base/json.cc:225:24: error: expected primary-expression before ‘>’ token
std::unique_ptr<Value> value;
^
/opt/caroline/base/json.cc:225:26: error: ‘value’ was not declared in this scope
std::unique_ptr<Value> value;
^
@cra
cra / -
Created February 10, 2014 09:10
[x_igomo@triolith1]-[10:09:21 Feb10] ~
$ rpm -qa | grep OFED
[x_igomo@triolith1]-[10:09:26 Feb10] ~
$ ibstat
CA 'mlx4_0'
CA type: MT4099
Number of ports: 1
Firmware version: 2.11.1022
Hardware version: 0
Node GUID: 0x0002c903003d2ce0
@cra
cra / BN test
Last active August 29, 2015 13:56
[cra@hannelore]-[14:09:53 Feb10] /tmp/green
$ ls
CHG DOSCAR INCAR kappastart OUTCAR POTCAR vasprun.xml
CHGCAR EIGENVAL infile.ssposcar KPOINTS PCDAT slurm-861063.out WAVECAR
CONTCAR IBZKPT infile.ucposcar OSZICAR POSCAR ucposcar.hcp XDATCAR
[cra@hannelore]-[14:10:00 Feb10] /tmp/green
$ process_outcar_5.3.py OUTCAR
posfile: infile.positions
forcefile: infile.forces
statfile: infile.stat
@cra
cra / -
Created February 20, 2014 14:27
total 88
-rw-r--r-- 1 cra users 1928 Feb 20 15:35 config.cc
-rw-r--r-- 1 cra users 972 Feb 20 15:35 config.h
-rw-r--r-- 1 cra users 1031 Feb 20 15:36 depth_map.cc
-rw-r--r-- 1 cra users 759 Feb 20 15:36 depth_map.h
-rw-r--r-- 1 cra users 2818 Feb 20 15:36 depth_mesh.cc
-rw-r--r-- 1 cra users 1046 Feb 20 15:36 depth_mesh.h
-rw-r--r-- 1 cra users 623 Feb 20 15:36 mesh.cc
-rw-r--r-- 1 cra users 1157 Feb 20 15:36 mesh.h
-rw-r--r-- 1 cra users 1881 Feb 20 15:36 ply_saver.cc
#!/usr/bin/gnuplot -persist
set term postscript enhanced color portrait size 8,8 solid
set output "./a.eps"
#set term tikz standalone solid fontscale 1 size 20cm, 15cm
#set output "/tmp/arsh.tex"
load "~/sandbox/linestyles.gnuplot"
#!/usr/bin/gnuplot -persist
#set term postscript enhanced color portrait size 8,8 solid
#set output "./a.eps"
set term tikz standalone solid #fontscale 1 #size 20cm, 15cm
set output "/tmp/arsh.tex"
load "~/sandbox/linestyles.gnuplot"
@cra
cra / fitoscript.py
Created March 5, 2014 14:48
A simple python script to calculate volumes and densities of your workout
#!/usr/bin/python
# coding: utf-8
import readline
import sys
import re
from decimal import Decimal
from datetime import datetime