Skip to content

Instantly share code, notes, and snippets.

@f-ilic
f-ilic / README.md
Created February 22, 2024 02:04 — forked from klamouri/README.md
Iterm2 Auto Dark/Light mode

Most of it is taken from this gist. I just tweaked the script to check the right theme at startup in case the theme change occured when iTerm2 was closed.

Make sure the theme is the same as the themes you have installed (Preferences > Profiles > Colors > Color Presets...). I personally use Solarized Dark and Solarized Light

From someone on the linked gist:

First-time installation steps for me:

  1. Download the script from GitHub by right-clicking on Raw button and save as...
  2. copy the script to $HOME/Library/Application Support/iTerm2/Scripts/AutoLaunch
  3. create AutoLaunch folder if it does not exist
  4. go to iTerm2 > Scripts > AutoLaunch
@f-ilic
f-ilic / README.md
Last active September 5, 2022 10:59
Desktop entry for whatsapp

What is dis

  • create .desktop entry for whatsapp
  • achieved by using webwhatsapp but starting it as chrome instance that looks like standalone appication
  • all thats left to do, is download this zip, and run setup.sh
@f-ilic
f-ilic / README.MD
Last active November 25, 2023 18:29
Remaping keyboard files

Remapping keys

  • Download .zip file, unzip, and cd into extracted
  • Run setup.sh
  • changes the US layout option to 21st century keyboard navigation
  • tldr; Capslock disabled, Capslock used as new modifier key
  • navigation with
    • caps + j, k, l, i = arrows in arrow layout
    • caps + u, o = home, end
  • caps + h, ; = backspace, delete
@f-ilic
f-ilic / gist:6a2f510e95ffe52161b04c4ef592b808
Last active September 26, 2017 10:45
Davix, Alessandro share
void test() {
TString configfeatures = gROOT->GetConfigFeatures();
if (configfeatures.Contains("davix"))
cout << "[ OK ] compiled correctly" << endl;
string cert = "/afs/cern.ch/user/f/filic/.globus/usercert.pem";
string key = "/afs/cern.ch/user/f/filic/.globus/userkey.pem";
gEnv->SetValue("Davix.GSI.UserCert",cert.c_str());
gEnv->SetValue("Davix.GSI.UserKey",key.c_str());
@f-ilic
f-ilic / main.py
Last active August 23, 2017 15:59
fb friend addition/removal plot
import matplotlib.pyplot as plt
import datetime as td
# In case anyone wants to try this themselves:
# Download your facebook zipped facebook history.
# There you'll find a file named fiends.html
# Format the paragraph with "added friends" / "deleted friends" to look like
# replacing </li><li> with newline
"""
@f-ilic
f-ilic / init.lua
Last active December 25, 2017 16:28
local function pressFn(mods, key)
if key == nil then
key = mods
mods = {}
end
return function() hs.eventtap.keyStroke(mods, key, 1000) end
end
local function remap(mods, key, pressFn)
@f-ilic
f-ilic / GuiPlotTool.md
Last active June 12, 2017 11:54
ROOT / CMS GuiPlotTool How-To manual

Goal

This tool is ment to Merge and Superimpose plots from DQMData.

UI Overview

UI Overview

UI Overview

TProfile2Poly

Addition of TProfile2Poly class. It is analogous to TH2D/TProfile2D; except it allows the creation of profiles of histograms that have polygonal bins. Just for a quick recap some of the functionality includes:

  • Creatation of bins that allow filling with Fill()
  • Setting the error being calculated as either kERRORSPREAD or kERRORMEAN
  • Setting the bin content to either the Average or Error in Z for plotting purposes (SetContentToAverage() / SetContentToAverage())
  • Merging whole Profile2Polys
using Pixel = vector<float>;
class Patch {
Patch(int x, int y, float* img, int img_width, int patchsize);
Pixel at(int x, int y) {
return getRow(y)[x];
}
vector<Pixel> getRow(int row_idx) {
@f-ilic
f-ilic / TProfile2Poly_Tutorial.md
Last active May 3, 2017 14:17
TProfile2Poly Tutorials

TProfile2Poly Tutorial 1

We will present how to use the TProfile2Poly class to create polygonal bins that simulate particle detector panels which are being hit by charged particles. The goal is to measure differences in charge if one or more such panels are malfunctioning.

Description

The geometry of the CMS Pixel end cap is stored as x,y coordinate triplet rows where where one triplet defines a detector panel.

The script generates numEvents (script argument) were their x,y coordinates are Gaussian distributed with 0 mean, but different sigmas. Each event also has a value (in our interpretation charge) associated with it.