Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohammad Sadegh Khoeini mkhoeini

View GitHub Profile
@mkhoeini
mkhoeini / hires.sh
Created Mar 31, 2020
Make KDE apps hires in macos
View hires.sh
sudo /usr/libexec/PlistBuddy -c 'Add :NSHighResolutionCapable string "True"' ~/Applications/KDE/dolphin.app/Contents/Info.plist
sudo /usr/libexec/PlistBuddy -c 'Add :NSPrincipalClass string "NSApplication"' ~/Applications/KDE/dolphin.app/Contents/Info.plist
View alacritty.yml
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
View autoload_myspacevim.vim
function! myspacevim#before() abort
" let g:neomake_enabled_c_makers = ['clang']
" nnoremap jk <Esc>
endfunction
function! myspacevim#after() abort
" let g:ale_fixers = {
" \ 'javascript': [
" \ 'eslint',
" \ 'prettier',
@mkhoeini
mkhoeini / tmux.conf
Last active May 29, 2019
Tmux Config
View tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-copycat'
View zplug.packages.zsh
zplug "zsh-users/zsh-autosuggestions"
zplug "bhilburn/powerlevel9k", use:powerlevel9k.zsh-theme
zplug "zsh-users/zaw", use:zaw/zaw.zsh
zplug "plugins/gitfast", from:oh-my-zsh
zplug "plugins/httpie", from:oh-my-zsh
zplug "plugins/lol", from:oh-my-zsh
zplug "plugins/git-extras", from:oh-my-zsh
zplug "plugins/osx", from:oh-my-zsh
zplug "plugins/gitignore", from:oh-my-zsh
zplug "plugins/github", from:oh-my-zsh
View keybase.md

Keybase proof

I hereby claim:

  • I am mkhoeini on github.
  • I am msk (https://keybase.io/msk) on keybase.
  • I have a public key ASDY6KSml8-YdDDyDoiyLYsji9Qm0BOxXjDLszqt6ngipQo

To claim this, I am signing this object:

@mkhoeini
mkhoeini / tween.cljs
Created Nov 29, 2015
Neet idea about tweening using reagent/reaction
View tween.cljs
; eurleif
;to Reagent-Project
;Nov 28
;I'm a newbie to Reagent, and I've just been playing around with it. I found a hack/pattern that seems pretty powerful. I'm curious if this is known/documented anywhere, and if there are problems with it that I haven't found. Any thoughts are appreciated.
;It starts with a "clock" reaction, which produces the current millisecond time:
(defonce clock
(let [callback-added? (reagent.ratom/atom false)
callback #(reset! callback-added? false)]
@mkhoeini
mkhoeini / component.es6.js
Created Sep 19, 2015
Samples of a simple counter in react, with multiple approaches
View component.es6.js
// Using es6 syntax and babel transformer
import React from 'react';
export class Component extends React.Component {
constructor(props) {
super(props);
this.state = {counter: 0};
}
View RPNcalc.d
// RPN calculator
import std.algorithm, std.container.array,
std.conv, std.stdio, std.meta;
void main()
{
Array!int stack;
void binop(string op)()
{
View request.js
import fetch from 'node-fetch';
import btoa from 'btoa';
function serverCallMaker(user, pass, baseUrl) {
const hash = btoa(`${user}:${pass}`);
const Authorization = `Basic ${hash}`;
const Accept = 'application/json; odata=verbose';
const params = {