Skip to content

Instantly share code, notes, and snippets.

View fleeto's full-sized avatar
🏠
Working from home

Vincent fleeto

🏠
Working from home
  • China
View GitHub Profile
@fleeto
fleeto / gist:9912971
Last active April 8, 2022 17:39
Drupal黑话入门

Drupal可能会让初学者深感畏惧。对大多数人来说,第一只拦路虎就是Drupal世界中一系列的术语,这些术语有的很生僻,有的在不同语境中有着不同的含义。要尽快的融入Drupal社区,同其他的Drupal爱好者沟通,最好能尽快的理解和使用Drupal的这些词汇。这里列出一些常用的Drupal术语。

Block - (这里保持原文,因常用的汉语翻译区块很容易和下句话中的区域混淆——译者注) Block用于将一小片内容摆放到页面的指定区域(例如左侧边栏,头部或底部等),例如一个包含了公司联系信息的Block可以放置到所有页面底部。或者将一个包含了相关商品的Block展示在一个目录下所有商品的详情页中。

Core - 也就是核心,指的是在Drupal.org下载的标准Drupal包中包含的缺省功能。这些功能包含Menu(Menu实际上和我们软件行业常说的菜单有很大区别,指的不是菜单,而是Drupal的Url系统——译者注)管理,用户管理,系统管理,设计和布局,以及分类系统等等。

Contrib - 是Drupal社区成员将一些新增的或变更的功能,以主题和模块的形式进行发布。这些模块和主题可以从 https://drupal.org/download 进行下载。

d.o - dropal.org的简称。发音为dee dot oh。

@fleeto
fleeto / gist:6be3398ae14044e2c579
Last active October 23, 2017 11:42
Drupal 8终极指南:第三部——网站建设的改进

Drupal 8终极指南:第三部——网站建设的改进

Angie Byron
Acquia.com

原文链接

网站建设

正如前两篇博客主要从最终用户以及内容编辑人员的角度对Drupal 8进行了介绍,Drupal 8同样对站点建设工具提供了大量改进。

@fleeto
fleeto / gist:71f765545b78bebb5aef
Created June 1, 2014 08:15
Drupal 8终极指南 增强的多语言特性
@fleeto
fleeto / gist:1d88f673e6c836ad63ab
Last active August 29, 2015 14:02
移动功能增强

#移动功能增强

编辑体验增强之外,对Drupal的最终用户来说,还有一个焦点问题是如何让Drupal 8对移动设备更加友好,这也是顺应当今移动设备访问量暴增的潮流之举。

##移动优先

Drupal 8用户会发现,Drupal 8从安装器到模块页面的设计核心思想都是以移动为中心的。每一个新特性,例如就地编辑等功能,都被设计为可以在移动设备的小屏幕上顺畅运行。读者可以尝试用手中的设备尝试访问Drupal 8,如果发现任何Bug,欢迎指出(呃....最好是有效的BUG)。

iphone

@fleeto
fleeto / drupal_hook_cron_best_practice.md
Last active August 29, 2015 14:02
hook_cron的最佳实践

如果你成功的设置了Drupal Cronhook_cron()提供了一种不依赖页面请求的方式来进行后台任务,然而,Cron的滥用也有可能造成性能问题,甚至威胁数据完整性。

这里提供一些我们在实际工作中得来不易的一些Cron方面的最佳实践:

##第一条:用变量控制Cron。

hook_cron()的每一次调用都封装在一个变量检查的条件之内,这个变量的缺省值是TRUE,想要禁止这个CRON,只要把这个变量创建起来并赋值为False即可,当你的CRON过程失控或者消耗太多资源时,这一手段是非常有效的。

/**
  • Implements hook_cron().
@fleeto
fleeto / drupal_settings.php
Last active August 29, 2015 14:09
Drupal settings.php汉化
<?php
/**
* @file
* Drupal站点配置文件
*
* 注意:
*
* 这个文件应该会被Drupal安装器设置为只读。
* 如果对该文件进行编辑,编辑完成后必须重新设置为只读,否则将成为安全隐患。
@fleeto
fleeto / pvc2gluster.py
Created October 12, 2017 06:19
GlusterFS as default storage class of Kubernetes, Usage: pvc2gluster.py [pvc name]
#!/usr/bin/python
import json
import subprocess
import sys
pvc_json = subprocess.check_output(
["kubectl", "get", "pvc", sys.argv[1], "-o", "json", "--all-namespaces"])
pvc_obj = json.loads(pvc_json)
pv_name = pvc_obj["spec"]["volumeName"]
@fleeto
fleeto / keycloak.yaml
Created April 8, 2018 18:37
Keycloak sidecar
---
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: httpbin-proxy
data:
proxy.json: |-
{
"target-url": "http://localhost:8000",
@fleeto
fleeto / snippets_markdown_vscode.json
Created November 11, 2018 13:54
Markdown snippetes
{
// Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix,body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1,$2 for tab stops,$0 for the final cursor position,and ${1:label},${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@fleeto
fleeto / find-updated-source-file.md
Created November 14, 2018 23:45
How we find updated files in istio.io

Initialization

git pull https://github.com/istio/istio.io.git git.io.master
cd git.io.master
git checkout master