Skip to content

Instantly share code, notes, and snippets.

View oksana-c's full-sized avatar

Oksana Cyrwus oksana-c

View GitHub Profile
@eojthebrave
eojthebrave / entity_fields.php
Created July 1, 2021 14:54
Output a CSV file listing all fields and properties for Drupal 7 entity types to help prepare for a migration.
<?php
/**
* @file
* Create a CSV file with fields for every Drupal 7 entity type / bundle.
*
* When preparing for a Drupal 7 to Drupal 8/9 migration it can be helpful to
* perform some initial content analysis. This script creates CSV files that
* can be imported into Google Sheets etc. to help with this analysis.
*

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@gr2m
gr2m / octokit_pika_build_setup.md
Last active August 16, 2019 15:42
This is a living document on JavaScript Octokit’s build setup using pika pack and semantic-release on GitHub Actions

Octokit.js build setup using @pika/pack

Install @pika/pack and build plugins

npm install --save-dev @pika/pack @pika/plugin-build-node @pika/plugin-build-web @pika/plugin-ts-standard-pkg

Configuration

@Schnitzel
Schnitzel / attacks.md
Last active April 16, 2018 19:40
Drupal SA-CORE-2018-002 attacks

Drupal SA-CORE-2018-002 attacks on amazee.io

Attack 1

First seen: April 13th 2018, 12:54:06

Array Key: #markup

Array Value:

@jwo
jwo / query.graphql
Last active November 26, 2020 15:11
GraphQL Example for GitHub API repo statuses on a pull request. We know before hand that it's "jwo/react-hover-image" and pull request number 4
{
repository(owner: "jwo", name:"react-hover-image"){
url
pullRequest(number: 4){
number
url
author {
avatarUrl
login
resourcePath
@jhedstrom
jhedstrom / notes.md
Created November 1, 2016 20:34
PHPUnit based tests in Drupal 8

Local setup

  • Environment variables:

    export SIMPLETEST_DB=mysql://user:pass@localhost/db_name
    export SIMPLETEST_BASE_URL=http://d8.dev
    
  • or copy core/phpunit.xml.dist to core/phpunit.xml and edit accordingly

@nickytonline
nickytonline / .gitconfig
Last active February 17, 2021 03:34
Git Aliases
alias.a add .
alias.aliases config --get-regexp alias
alias.bi bisect
alias.ci commit -m
alias.co checkout
alias.colast checkout -
alias.db branch -D
alias.laf fsck --lost-found
alias.last log -1 HEAD
alias.nb checkout -b
@bmunslow
bmunslow / entityqueue-add-items.php
Last active July 18, 2024 08:31
Drupal 7 - Programatically add items to EntityQueue
<?php
/**
* This snippet adds all nodes belonging to a specific node type to all
* entityqueues found in the system, defined by Entityqueue module
* Customize to your own needs by modifying relevant parts of the code.
* @see https://www.drupal.org/project/entityqueue
*/
// Get all available entityqueue queues
$all_queue_names = variable_get('entityqueue_queue_names', array());
foreach ($all_queue_names as $queue_name) {
@oxguy3
oxguy3 / deploy.php
Last active August 5, 2023 20:21
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@mesgarpour
mesgarpour / appsScript_ListFilesFolders_ver.2.js
Last active July 18, 2024 06:09
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software