Skip to content

Instantly share code, notes, and snippets.

View Linrstudio's full-sized avatar
🌴
On vacation

xyz Linrstudio

🌴
On vacation
View GitHub Profile
@thinkgarden
thinkgarden / across.client.js
Created August 29, 2018 04:43 — forked from yueyuzhao/across.client.js
代理翻墙 (nodejs实现)
// 客户端实现
const net = require('net')
const tls = require('tls')
const localServer = new net.Server()
localServer.on('connection', (socket) => {
socket.pause()
const context = {
@dreamyguy
dreamyguy / package.json
Last active January 7, 2023 08:54
Custom build output folder when using create-react-app with postbuild
{
"name": "your-project",
"version": "0.0.1",
[...]
"scripts": {
"build": "react-scripts build",
"postbuild": "./postbuild.sh",
[...]
},
}
function zipmerge(/* ...lists */) {
var lists = Array.prototype.slice.call(arguments)
// find longest list
var nlists = lists.length, maxlen = 0, i
for (i = 0; i < nlists; i++) {
maxlen = Math.max(arguments[i].length, maxlen)
}
// populate result
var artboards = context.document.valueForKeyPath("[email protected]"),
artboardLoop = artboards.objectEnumerator(),
artboard;
while (artboard = artboardLoop.nextObject()) {
artboard.exportOptions().setLayerOptions(2);
}
function findStringInTextLayers(textToFind,exactMatch,currentPage) {
var predicate = NSPredicate.predicateWithFormat("className == %@","MSTextLayer"),
textLayers = NSMutableArray.array();
if (currentPage == 1) {
var page = context.document.currentPage();
textLayers.addObjectsFromArray(page.children().filteredArrayUsingPredicate(predicate));
} else {
var pages = context.document.pages(),
@voluntas
voluntas / webrtc_data_channel.rst
Last active January 3, 2025 11:07
WebRTC DataChannel コトハジメ
const fs = require('fs')
const Path = require('path')
function mkdirs(path, p) {
if (p === undefined) {
p = path.length
path = Path.resolve(path)
}
try {
fs.mkdirSync(path)
@rsms
rsms / diff-fonts-with-sfddiff.md
Created July 17, 2018 15:54
Use sfddiff to find difference between font files
sfddiff [-merge outfile] [-ignorehints] [-ignorenames] [-ignoregpos] [-ignoregsub] [-ignorebitmaps]
        [-exact] [-warn] [-version] [-help] fontfile1 fontfile2

Sfddiff compares (or merges) two font files (in any format fontforge can read) and checks for differences.

It will notice:

  • any characters present in one font but not in the other
@hteumeuleu
hteumeuleu / mso-allowpng.html
Created July 6, 2018 13:41
Is AllowPNG actually useful ?
<!DOCTYPE html>
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" lang="fr">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
@rsms
rsms / figma-project-stats.js
Created June 21, 2018 19:17
Script that generates statistics for a Figma project, like number of files, frames, versions etc
//
// Figma project stats
// Pulls statistics like number of files, frames, versions etc for a project.
//
// Usage:
// export FIGMA_API_ACCESS_TOKEN='your-token'
// node figma-project-stats.js <project-id>
//
// You can generate tokens in your account settings or at
// https://www.figma.com/developers/explorer#personal-access-token