Skip to content

Instantly share code, notes, and snippets.

@codezixo
codezixo / d7.php
Created Jun 21, 2022 — forked from d1i1m1o1n/d7.php
Bitrix(d7). DB query
View d7.php
<?php
use Bitrix\Main\Application;
$connection = Application::getConnection();
$sqlHelper = $connection->getSqlHelper();
$sql = "SELECT ID FROM b_user WHERE LOGIN = '".$sqlHelper->forSql($login, 50)."'";
//$connection->query($sql, $limit);
//$connection->query($sql, $offset, $limit);
@codezixo
codezixo / iteration-and-recursive-iteration.php
Created Feb 24, 2021 — forked from hakre/iteration-and-recursive-iteration.php
Iteration and Recursive Iteration Examples Code
View iteration-and-recursive-iteration.php
<?php
/*
* Iteration and Recursive Iteration Examples Code
*
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php
* @author hakre <http://hakre.wordpress.com>
*/
### To have these examples to work, a directory with subdirectories is needed,
### I named mine "tree":
@codezixo
codezixo / scriptLoader.js
Created Dec 16, 2020
js dynamic script load ( like import() )
View scriptLoader.js
function scriptLoader() {
/**
* Promise-based script loader
* @param {string} url
* @param {object=} attr
* @returns {Promise}
*/
const loader = (url, attr) => new Promise((resolve, reject) => {
const script = window.document.createElement('script');
script.src = url;
@codezixo
codezixo / check-status.hs
Created Jun 15, 2020 — forked from snoyberg/check-status.hs
Check HTTP status codes
View check-status.hs
#!/usr/bin/env stack
-- stack --resolver lts-15.10 script
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
import RIO
import Network.HTTP.Simple
import qualified RIO.Text as T
main :: IO ()
main = runSimpleApp $ do
View netspeed.sh
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-09
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, westm, rbx, sbg, bhs URL]
# Default server is RBX FR.
# First try it out without any arguments.
#
@codezixo
codezixo / netspeed.sh
Created Oct 6, 2018 — forked from tazhate/netspeed.sh
netspeed.sh : check download speed rate via command line | Linux bash script
View netspeed.sh
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-09
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#
View My Exiftool Cheatsheet.md

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@codezixo
codezixo / gist:bc9d63aff010dce21051487def836e29
Created Aug 9, 2018 — forked from phayes/gist:2770495
Manually rendering ctools-content-type
View gist:bc9d63aff010dce21051487def836e29
<?
ctools_include('plugins');
ctools_include('context');
ctools_include('content');
$plugin_id = 'super_pane';
$plugin = ctools_get_plugins('ctools','content_types', $this->options['field'], $plugin_id);
$conf = array() // array of configuration to pass to the content-type
@codezixo
codezixo / imagemagick.bash
Created May 4, 2018 — forked from bensie/imagemagick.bash
ImageMagick Static Binaries for AWS Lambda
View imagemagick.bash
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime
# As of Nov 23, 2015, this is Amazon Linux AMI 2014.09.2 x86_64 (ami-0c682c64)
#
# Lambda includes ImageMagick 6.7.8-9 preinstalled, so you need to prepend PATH
# with the folder containing these binaries in your Lambda function to ensure
# these newer binaries are used.
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel gcc
@codezixo
codezixo / Breadcrumbs.php
Created Nov 8, 2017 — forked from jonpugh/Breadcrumbs.php
Add Taxonomy Term to a Node's Breadcrumb in Drupal 8
View Breadcrumbs.php
<?php
// src/Breadcrumbs.php
namespace Drupal\modulename;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Link;