Для большинства PHP-приложений достаточно использовать jQuery-плагин. Он проще в подключении и красиво выглядит. Используйте прямую работу с API на PHP только в том случае, если вы твёрдо уверены, что jQuery-плагин не подходит.
From: https://github.com/FallibleInc/security-guide-for-developers
- Use HTTPS everywhere.
- Store password hashes using
Bcrypt(no salt necessary -Bcryptdoes it for you).
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 | |
| set -e -u -o pipefail | |
| { | |
| echo 'digraph G {' | |
| brew list | while read cask; do | |
| printf '"%s";\n' $cask | |
| brew deps $cask | while read dep; do |
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
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
| # Based on http://frantic.im/notify-on-completion and https://gist.github.com/jamesmacaulay/860763 | |
| # Notify on completion | |
| function f_notifyme { | |
| LAST_EXIT_CODE=$? | |
| CMD=$(fc -ln -1) | |
| terminal-notifier -title "$CMD" -message "Status code: $LAST_EXIT_CODE" & | |
| } | |
| save_preexec_time() { | |
| export PREEXEC_CMD="$(history | tail -1 | sed 's/ *[0-9]* *//')" |
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
| from slacker import Slacker | |
| import json | |
| import argparse | |
| import os | |
| import shutil | |
| import copy | |
| from datetime import datetime | |
| # This script finds all channels, private channels and direct messages | |
| # that your user participates in, downloads the complete history for |
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
| <?php | |
| if (!isset($_GET['user'])) { | |
| if (!isset($_GET['hashtag'])) { | |
| exit('Not a valid RSS feed. You didn\'nt provide an Instagram user or hashtag. Send one via a GET variable. Example .../instarss.php?user=snoopdogg'); | |
| } | |
| } | |
| if (isset($_GET['user']) && isset($_GET['hashtag'])) { | |
| exit('Don\'t request both user and hashtag. Request one or the other.'); |
exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.
If Disk Utility is unable to repair, consider trying this:
- In Disk Utility, ensure that the drive is not mounted, eject it if it is mounted.
- Use
diskutil listto find the right drive id. - You want the id under the IDENTIFIER column, it should look like
disk1s1 - Run
sudo fsck_exfat -d <id from above>. egsudo fsck_exfat -d disk1s3 -dis debug so you'll see all your files output as they're processed.
##Где трепаться?
http://telegram.me/klavaorgwork - Телеграм, вопросы разработки
##Железо
####Приобретение свитчей
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/env bash | |
| ## Needs `jq` (https://stedolan.github.io/jq/) on PATH | |
| ## and a personal gogs token of yours. | |
| ## Obtain token from https://git.example.com/user/settings/applications | |
| ## Usage: | |
| ## ./migrate.sh $clone_url $project_name [$optional_group] | |
| ## Migrate a repository to gogs into the user namespace of the token-user | |
| ## ./migrate.sh [email protected]:group/repo.git repo | |
| ## Migrate a repository to gogs into the group namespace `group` (needs to exist) |