Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
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
REPOS/TELEGRAM CHANNELS LIST BY u/angkitbharadwaj (visit https://fmhy.net/android-iosguide#ios-ipas for more sources) | |
**These are links to be used with Feather, ESign, Scarlet, etc.** | |
-ethMods Repo Access: | |
https://repo.ethsign.fyi | |
Esign:https://repo.ethsign.fyi | |
Gbox:https://repo.ethsign.fyi | |
Trollstore:https://repo.ethsign.fyi |
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
#Requires AutoHotkey v2.0+ | |
#SingleInstance Force | |
#Warn | |
SetTitleMatchMode 2 ; Allows partial title matching | |
FileEncoding "UTF-8" | |
DOTA_WINDOW := "ahk_exe dota2.exe" | |
CapsLock:: | |
{ |
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
# /app/models/concerns/has_many_attached.rb | |
module HasManyAttached | |
extend ActiveSupport::Concern | |
class_methods do | |
def has_many_attached(name, dependent: :purge_later, service: nil, strict_loading: false, **options) | |
super(name, dependent: :purge_later, service: nil, strict_loading: false) | |
if options[:file_types].any? | |
validate "validate_#{name}_file_types".to_sym |
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
# Collection has and belongs to many Projects through CollectionProject | |
# Usage | |
@collections = current_user.collections.page(1) | |
ActiveRecord::Associations::Preloader.new.preload(@collections, :projects, limited_projects(3)) | |
# Now @collections.first.projects will have only first 3 projects accessible | |
# Constructs SQL like this to preload limited number of recent projects along with collections: | |
# SELECT * FROM ( | |
# SELECT "projects".*, row_number() OVER (PARTITION BY collection_projects.collection_id ORDER BY collection_projects.created_at) AS collection_position |
Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force
в не тот remote
и/или не в ту ветку.
Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push
нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend
по запарке вместо git push deis master --force
делается просто git push --force
. Упс.
Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…
Но это git, а значит всё можно починить!
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 | |
set -eu | |
AGGRESSIVE=0 | |
PARAMS="" | |
while [ "$#" -gt 0 ]; do | |
case "$1" in | |
--aggressive) |
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
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
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
# Makes git push and creates Merge Request at the same time | |
# If you follow branch naming convention like "ucp-123/new-authorization", MR title will be "UCP-123 New authorization", which will be cross-linked to Jira | |
# Make sure to replace "ucp" with your shortcut. | |
# IMPORTANT PREREQUISITE: to run `git config committer.name <your_gitlab_username>` once, so that it gets used for `make publish!` to assign MR to you | |
USERNAME := $(shell git config committer.name) | |
BRANCH := $(shell git rev-parse --abbrev-ref HEAD) | |
ticket_pattern := ucp-[0-9][0-9][0-9] | |
TICKET := $(shell git rev-parse --abbrev-ref HEAD | grep -o '$(ticket_pattern)' | tr [:lower:] [:upper:]) |
NewerOlder