Skip to content

Instantly share code, notes, and snippets.

View tureki's full-sized avatar
🐢
(╯°□°)╯︵ ┻━┻

Kah Wai Liew tureki

🐢
(╯°□°)╯︵ ┻━┻
View GitHub Profile

How to install game-porting-toolkit (aka proton for macOS)

You also might wanna just use Whisky which does this automatically

This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.

@sindresorhus
sindresorhus / esm-package.md
Last active May 11, 2024 11:39
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
componentWillReceiveProps(nextProps) {
if (nextProps.lastRequestedUserLocationAt > this.props.lastRequestedUserLocationAt) {
this.centerMapToUser(nextProps.currentLocation);
}
if (nextProps.lastUpdated > this.props.lastUpdated) {
const markers = this.createMarkersForLocations(nextProps);
if (markers && Object.keys(markers)) {
const clusters = {};
@subfuzion
subfuzion / curl.md
Last active May 9, 2024 18:17
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

// 1. 打開 Slack 網頁版
// 2. 開啟需要備份的對話視窗,包含 Direct Message 或 Channel 都可以
// 3. 打開 Chrome Dev Tools 的 Console
// 4. 複製貼上以下程式碼
// 5. 執行 JS 並輸出歷史訊息
// 6. 換下一個 Channel 繼續備份
// 7. 重複第4個步驟
// PS. 輸出到 Console 的歷史訊息,可以透過在空白處按右鍵 -> Save as ,另存成文字檔
var historyMessages = `[Slack Export History Messages] SEHM\n`;
@esamattis
esamattis / WebViewAutoHeight.js
Last active February 11, 2022 16:01
React native: Is it possible to have the height of a html content in a webview? http://stackoverflow.com/q/32952270
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Esa-Matti Suuronen <esa-matti@suuronen.org>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@jaceju
jaceju / Front-end-Developer-Interview-Questions-TC.md
Created November 19, 2015 06:27 — forked from hanksudo/Front-end-Developer-Interview-Questions-TC.md
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

@mttjohnson
mttjohnson / magento2-include-static-blocks.md
Last active May 23, 2021 20:05
Magento 2 - Include Static Blocks (template/cms/layout)

In .phtml tempalte file:

<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_identifier')->toHtml();?>

In CMS content:

{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}}

In layout .xml file:

<referenceContainer name="content">
  <block class="Magento\Cms\Block\Block" name="block_identifier">

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@jaceju
jaceju / start_gitlab.sh
Last active August 29, 2015 14:13
Start and run GitLab on docker
#!/bin/bash
# Usage
# boot2docker up && start_gitlab
# Remove old container
remove_container(){
CONTAINER=$1
RUNNING=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null)
retval=$RUNNING