-
Что такое инвариант цикла?
-
Что такое сложность алгоритма? O(n) нотация. O(???) для операций с NSArray, NSDictionary, запрос в БД (индексированный VS. неиндексированный)
-
CS data structures (linked list, binary tree, array)
-
Различия аутентификации, авторизации
This file contains 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
osascript -e 'tell application "iOS Simulator" to quit' | |
osascript -e 'tell application "Simulator" to quit' | |
xcrun simctl erase all |
This file contains 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
import android.view.View; | |
import org.hamcrest.Description; | |
import org.hamcrest.Matcher; | |
import org.hamcrest.TypeSafeMatcher; | |
import static org.hamcrest.Matchers.is; | |
public class CustomMatchers { | |
public static Matcher<View> withResourceName(String resourceName) { |
This file contains 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 | |
# | |
# Log commit messages as a 'highlight' in RescueTime Premium for Mercurial | |
# | |
# To enable this hook: | |
# | |
# 1. Get your API key from https://www.rescuetime.com/integrations/git | |
# 2. Place this file somewhere | |
# 3. Make sure it has executable permissions (chmod +x post-commit) | |
# 4. add line commit=path/to/this to [hooks] session of your .hgrc |
This file contains 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
package com.viorsan.gists.example1 | |
import android.view.Gravity; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; | |
import android.widget.RelativeLayout; | |
import android.widget.TextView; |
This file contains 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 | |
wget -q -O /tmp/ips http://reestr.rublacklist.net/api/ips || exit 404 | |
HASH=$(md5sum /tmp/ips | awk '{print $1}') | |
HASH_LAST=$(cat /tmp/ips.hash) | |
if [[ $HASH == $HASH_LAST ]] && [[ $(ip ro list dev tun2) != "" ]];then | |
exit 304 | |
fi | |
IPS=$(cat /tmp/ips | sed 's|;|\n|g' | /bin/grep -E ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$; cat /root/addition_ips) | |
for rule in $(ip ro list dev tun2 | awk '{print $1}');do |
This file contains 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
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 Circle Internet Financial | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains 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 | |
AUTHORIZED_KEYS=authorized_keys | |
HOST_RSA_KEY=ssh_host_rsa_key | |
SSHD=/usr/sbin/sshd | |
PORT=8443 | |
case "$AUTHORIZED_KEYS" in /*) ;; *) AUTHORIZED_KEYS=$PWD/$AUTHORIZED_KEYS ;; esac | |
case "$HOST_RSA_KEY" in /*) ;; *) HOST_RSA_KEY=$PWD/$HOST_RSA_KEY ;; esac |
This file contains 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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau | |
Africa/Blantyre |
This file contains 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
# MikroTik (RouterOS) script for automatically setting DNS records | |
# for clients when they obtain a DHCP lease. | |
# | |
# author SmartFinn <https://gist.github.com/SmartFinn> | |
:local dnsTTL "00:15:00"; | |
:local token "$leaseServerName-$leaseActMAC"; | |
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone") | |
# - truncate length to 63 chars |