Instantly share code, notes, and snippets.
evgenyneu /setup_cursor_ubuntu.md
Last activeJuly 18, 2025 17:19
Install Cursor AI code editor on Ubuntu 24.04 LTSevgenyneu /loosing_marbles.py
CreatedMay 21, 2020 05:09
Calculate probability distribution of black marbles in a bag, given observed proportion in the sample form the bag This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
importnumpyasnp | |
fromscipyimportstats | |
importmatplotlib.pyplotasplt | |
deffind_posterior(M,N,p,p_hpdi): | |
""" | |
Wehaveabagcontainingblackandwhitemarbles,`M`intotal. | |
Wedon'tknowhowmanyblackmarblesareinthebag. | |
Wetake`N`fromthebagandcounttheproportionofblackmarbles`p`. |
evgenyneu /yorick.sublime-syntax
Last activeNovember 26, 2018 23:23
Syntax file for Yorick language for Sublime Text 3. Copy the file into "Sublime Text 3/Packages/User/" directory. Credithttps://github.com/facelessuser/sublime-languages This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
%YAML 1.2 | |
--- | |
# http://www.sublimetext.com/docs/3/syntax.html | |
name:C/C++(11) | |
file_extensions: | |
-i | |
first_line_match:|- | |
(?x) | |
-[*]-( Mode:)? C -[*]- | |
| |
evgenyneu /LaTeXSubDir.sublime-build
CreatedSeptember 11, 2018 09:51
Sublime text build file to build LaTeX in a sub directory This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
{ | |
"cmd": ["mkdir -p metafiles && /Library/TeX/texbin/pdflatex -output-directory metafiles '$file'"], | |
"shell":true, | |
"selector":"text.tex.latex" | |
} |
evgenyneu /LaTeX.sublime-build
Last activeFebruary 25, 2020 05:19
LaTeX build file for Sublime Text 3 for MacOS. Builds PDF (Command-B) and bibliography (Shift-Command-B). This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
{ | |
"cmd": ["/Library/TeX/texbin/pdflatex","$file"], | |
"selector":"text.tex.latex", | |
"variants": [ | |
{ | |
"name":"Build Bibliography", | |
"cmd": ["/Library/TeX/texbin/bibtex","$file_base_name"], | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
ACCESS_TOKEN=secret | |
ENVIRONMENT=production | |
LOCAL_USERNAME=`whoami` | |
REVISION=`git log -n 1 --pretty=format:"%H"` | |
curl https://api.rollbar.com/api/1/deploy/ \ | |
-F access_token=$ACCESS_TOKEN \ | |
-F environment=$ENVIRONMENT \ | |
-F revision=$REVISION \ | |
-F local_username=$LOCAL_USERNAME |
evgenyneu /LeTeX.sublime-build
Last activeOctober 17, 2021 06:26
A build file Sublime Text 3 that builds a PDF from LaTeX on macOS This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
{ | |
"cmd": ["/Library/TeX/texbin/pdflatex '$file' && open -a Skim.app '$file_path/$file_base_name.pdf'"], | |
"shell":true, | |
"selector":"text.tex.latex" | |
} |
evgenyneu /concatenate_swift_files.sh
Last activeMarch 27, 2023 00:35
Concatenates all Swift files into one file. Used in Xcode to build a single swift distributive file. In Xcode it is done by creating an external build tool configuration. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Combines *.swift files into a single file. Used in Xcode to build a single swift distributive file. | |
# | |
# Here is how to use it in Xcode: | |
# | |
# 1. Create an "External build system" target. | |
# 2. Click "Info" tab in target settings. | |
# 3. In "Build Tool" field specify the path to this script file, for example: $PROJECT_DIR/scripts/concatenate_swift_files.sh |
evgenyneu /AutoCancellingTimer.swift
Last activeSeptember 24, 2016 03:08
Auto-cancelling Swift timer. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// | |
// Creates a timer that executes code after delay. The timer lives in an instance of `AutoCancellingTimer` class and is automatically canceled when this instance is deallocated. | |
// This is an auto-canceling alternative to timer created with `dispatch_after` function. | |
// | |
// Source: https://gist.github.com/evgenyneu/516f7dcdb5f2f73d7923 | |
// | |
// Usage | |
// ----- | |
// | |
// class MyClass { |
evgenyneu /undo_ios_carthage_except.sh
Last activeAugust 21, 2018 15:23
Undo frameworks built by Carthage except the one given framework This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Script for Xcode and Carthage | |
# ------------------------------ | |
# | |
# Dismisses changes to all the frameworks except the given frameworks in the iOS build folder. | |
# This is used to undo the changes done to the framework build after `carthage update` command. | |
# | |
# |
NewerOlder