time.google.com
time1.google.com
time2.google.com
time3.google.com
| #!/bin/bash | |
| # URL to fetch Cloudflare IP ranges | |
| ipv4_url="https://www.cloudflare.com/ips-v4" | |
| ipv6_url="https://www.cloudflare.com/ips-v6" | |
| # Temporary files to store IP ranges | |
| tmp_ipv4="/tmp/cloudflare_ipv4.tmp" | |
| tmp_ipv6="/tmp/cloudflare_ipv6.tmp" |
| <?php | |
| // Detect requests from Livewire | |
| Request::macro('isFromLivewire', function() { | |
| return $this->headers->has('x-livewire'); | |
| }); |
| // create a bookmark and use this code as the URL, you can now toggle the css on/off | |
| // thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
| javascript: (function() { | |
| var elements = document.body.getElementsByTagName('*'); | |
| var items = []; | |
| for (var i = 0; i < elements.length; i++) { | |
| if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
| items.push(elements[i]); | |
| } | |
| } |
| {# Get URL of single file field #} | |
| {{ node.field_file.entity.uri.value }} | |
| {# Get URL of multi file field #} | |
| {{ node.field_file['#items'].entity.uri.value }} | |
| {# Trun into link #} | |
| {{ file_url(node.field_file.entity.uri.value) }} | |
| {# Check if there is at least one value #} |
| <?php | |
| use Drupal\Core\Form\FormStateInterface; | |
| function example_ajax_form_alter() { | |
| $ajax_form_request = \Drupal::request()->query->has(FormBuilderInterface::AJAX_FORM_REQUEST); | |
| if ($ajax_form_request) { | |
| if (!$form_state->isProcessingInput()) { | |
| \Drupal::logger('example')->notice('first pass'); | |
| } |
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
| iPad (Actual pixels in brackets) | |
| 1024 × 690 (2048 x 1380) In landscape on iOS 4.3 | |
| 1024 × 672 (2048 x 1344) In landscape on iOS 5 | |
| 768 × 946 (1536 x 1892) In portrait on iOS 4.3 | |
| 768 × 928 (1536 x 1856) In portrait on iOS 5 | |
| 1024 × 660 (2048 x 1320) Always showing bookmarks bar in landscape on iOS 4.3 | |
| 1024 × 644 (2048 x 1288) Always showing bookmarks bar in landscape on iOS 5 | |
| 768 × 916 (1536 x 1832) Always showing bookmarks bar in portrait on iOS 4.3 |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |