Skip to content

Instantly share code, notes, and snippets.

View tedyyu's full-sized avatar

Tedy tedyyu

  • Shanghai
View GitHub Profile
@tedyyu
tedyyu / ESTypeScriptExampleOfCallingAlicloudDirectMailJSSDK.ts
Last active January 8, 2024 08:05
How to call AliCloud's DirectMail JS SDK in your TypeScript ES project
//Here is a rescue if you meet "TypeError: Dm20151123 is not a constructor" or similar errors when calling Alicloud DirectMail JS SDK in your TypeScript with ES module project
//https://api.alibabacloud.com/api-tools/sdk/Dm?version=2015-11-23&language=nodejs-tea&tab=primer-doc
//It seems SDK uses commonjs (CJS) module only
//So the fix is to build a wrapper using TypeScript CJS, and call it from your TypeScript ES project
//here is an example
//如果在TypeScript with ES模块项目中调用阿里云DirectMail JS SDK时遇到“TypeError: Dm20151123 is not a constructor”或类似错误,这里有一个救援方法
//https://api.alibabacloud.com/api-tools/sdk/Dm?version=2015-11-23&language=nodejs-tea&tab=primer-doc
//看来SDK只使用了commonjs (CJS)模块
//因此解决方法是使用 TypeScript CJS 构建一个包装器(Wrapper),并从 TypeScript ES 项目中调用它
@Lakshmipathi
Lakshmipathi / v8gen.py.txt
Created December 1, 2021 13:52 — forked from AlexMasterov/v8gen.py.txt
gn args {V8}/out.gn/x64.release/ --list (V8 v7.1.163)
action_pool_depth
Current value (from the default) = -1
From //build/toolchain/BUILD.gn:10
Pool for non goma tasks.
android_full_debug
Current value (from the default) = false
From //build/config/compiler/BUILD.gn:48
@vczb
vczb / sources.list
Last active March 13, 2024 18:13
Ubuntu 20.04 /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
@LGM-AdrianHum
LGM-AdrianHum / JunctionPoint.cs
Last active April 16, 2023 18:27
Create, Delete and Examine Junction Points in C#
// File: RollThroughLibrary/CreateMaps/JunctionPoint.cs
// User: Adrian Hum/
//
// Created: 2017-11-19 2:46 PM
// Modified: 2017-11-19 6:10 PM
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
@lord-carlos
lord-carlos / ytdl.sh
Last active August 5, 2023 03:19
Uses youtube-dl with 15 threads
#!/bin/bash
#youtube-dl --external-downloader axel --external-downloader-args "-n 15 -a -k" "$@"
youtube-dl --external-downloader aria2c --external-downloader-args "-c -j 5 -x 10 --summary-interval=0" "$@"
@brianpursley
brianpursley / iBeacon-Windows10-C#-Program.cs
Created February 2, 2017 13:50
iBeacon Windows 10 Console Application using C#
using System;
using System.Linq;
using Windows.Devices.Bluetooth.Advertisement;
using Windows.Storage.Streams;
namespace BeaconExample
{
class Program
{
private class BeaconData
@lokhman
lokhman / ubuntu-hardening.md
Last active April 23, 2024 09:05
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@tedmiston
tedmiston / nodejs-tcp-example.js
Last active February 19, 2024 21:55
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@MihailJP
MihailJP / scala.xml
Last active April 19, 2024 01:14
Notepad++ syntax highlighting definition file for Scala
<NotepadPlus>
<UserLang name="Scala" ext="scala" udlVersion="2.0">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments" id="0">00// 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, additional" id="1"></Keywords>
<Keywords name="Numbers, prefixes" id="2">0x</Keywords>