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
// based on ggwarpig stackoverflow anwser to | |
// "Where do I find the Instagram media ID of a image" | |
// @ https://stackoverflow.com/a/37246231 | |
function instagram_id_to_url($instagram_id){ | |
$url_prefix = "https://www.instagram.com/p/"; | |
if(!empty(strpos($instagram_id, '_'))){ |
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
<?php | |
class Car { | |
private $model; | |
public function __construct( $model ) { | |
$this->model = $model; | |
} | |
public function get_model() { |
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
git archive --output=file.zip HEAD $(git diff --name-only SHA1 SHA2) |
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 { Plugins } from '@capacitor/core'; | |
import 'capacitor-data-storage-sqlite'; | |
export function useStorage(options: any = {}) { | |
const { CapacitorDataStorageSqlite } = Plugins; | |
const storage: any = CapacitorDataStorageSqlite; | |
let opened = false; | |
const openStorage = async (): Promise<boolean> => { |
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 | |
## | |
# MySQL DB dump to Git commit | |
# | |
# Dumps the specified mysql database to the given location and commits it and | |
# the previous database to the Git repository. | |
# | |
# It is assumed you have already setup the Git respository to only be the | |
# a checkout of the database backup location |
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
<?php | |
// Works in every situations | |
function by_token ($src) { | |
$tokens = token_get_all($src); | |
$count = count($tokens); | |
$i = 0; | |
$namespace = ''; | |
$namespace_ok = false; | |
while ($i < $count) { |
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
<?php | |
############################################################### | |
# cPanel Subdomains Creator 1.1 | |
############################################################### | |
# Visit http://www.zubrag.com/scripts/ for updates | |
############################################################### | |
# | |
# Can be used in 3 ways: | |
# 1. just open script in browser and fill the form |
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 | |
# -*- 2fa Command Line -*- | |
# | |
# Uses oath-toolkit http://nongnu.org/oath-toolkit/ | |
# to generate 2FA OTPs and copies them in the Mac's | |
# clipboard using pbcopy(1). For other UNIX systems | |
# you can just strip the pbcopy at the bottom. | |
# | |
# In the dir below you should put TOTP token seeds, |
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
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class LaravelConditionalIndexMigration extends Migration | |
{ | |
/** | |
* Run the migrations. |
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
<?php | |
ini_set('pcre.backtrack_limit', '10000000'); | |
$url = 'https://ru.tradingview.com/chart/VIX/veShLNLq-vix/'; // Ссылка на торговую идею trading view | |
$filename = dirname(__FILE__) . '/candles.json'; // Путь к файлу, в который будут сохранены свечи | |
$html = file_get_contents($url); | |
if (empty($html)) { |
OlderNewer