Skip to content

Instantly share code, notes, and snippets.

View xiaohutai's full-sized avatar

Xiao-Hu Tai xiaohutai

  • The Netherlands
View GitHub Profile

Experimental Generation of Interpersonal Closeness

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You have been given three sets of slips. Each slip has a question or a task written on it. As soon as you both finish reading these instructions, you should

@xiaohutai
xiaohutai / git patterns.md
Created September 10, 2016 12:36 — forked from wayspurrchen/git patterns.md
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@xiaohutai
xiaohutai / bolt-ckeditor.md
Created November 14, 2017 11:16
Set custom tags in Bolt CKEditor

In app/config/config.yml:

wysiwyg:
    (...)
    ck:
        (...)
        format_tags: "p;h2;h3;h4;info;warning;error;success"
        format_info: { name: "Info", element: "p", attributes: { 'class': 'info' } }
 format_warning: { name: "Warning", element: "p", attributes: { 'class': 'warning' } }
li:nth-child(3n)::before { content: 'fizz'; }
li:nth-child(5n)::before { content: 'buzz'; }
li:nth-child(3n):nth-child(5n)::before { content: 'fizz-buzz'; }
li { counter-increment: myCounter; }
li::before { content: counter(myCounter); }

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@xiaohutai
xiaohutai / uploadSanitiser.php
Last active January 26, 2018 12:42 — forked from rossriley/uploadSanitiser.php
Bolt: Extending the upload handler with custom sanitiser
$app['upload'] = $app->share(
$app->extend(
'upload',
function ($uploadHandler) {
// Set max file size
$uploadHandler->addRule('size', ['max' => '2M'])
// Sanitize filename
$uploadHandler->setSanitizerCallback(
* * * * * /var/www/app/nut cron --run=cron.Hourly
<?php
public function onMountControllerAfter(MountEvent $event){
$app = $event->getApp();
foreach ($this->registerFrontendControllers() as $prefix => $collection) {
$event->mount($prefix, $collection);
}
if ($app['routes']->count() > 0) {
@xiaohutai
xiaohutai / .bolt.yml
Last active March 19, 2018 13:01
Fix that allows previewing blocks (named repeaters) in Bolt 3.4+
extensions:
- Bolt\Extension\Foo\Bar\FixPreviewBlocksExtension
@xiaohutai
xiaohutai / Multiple Deploy Keys in GitHub.md
Created July 17, 2018 12:39 — forked from mcfdn/Multiple Deploy Keys in GitHub.md
Using multiple GitHub deploy keys on a single server with a single user

Using multiple GitHub deploy keys on a single server with a single user

Within GitHub it is possible to set up two types of SSH key - account level SSH keys and and repository level SSH keys. These repository level SSH keys are known in GitHub as deploy keys.

Deploy keys are useful for deploying code because they do not rely on an individual user account, which is susceptible to change, to “store” the server keys.

There is, however, an ‘issue’ with using deploy keys; each key across all repositories on GitHub must be unique. No one key can be used more than once. This becomes a problem when deploying to repositories to the same server with the same user. If you create two keys, the SSH client will not know which key to use when connecting to GitHub.

One solution is to use an SSH config file to define which key to use in which situation. This isn’t as easy as it seems.. you might try something like this: