Skip to content

Instantly share code, notes, and snippets.

View engalar's full-sized avatar

wengao liu engalar

  • https://www.mendix.com/
  • zhuhai/guangdong/china
  • 13:08 (UTC +08:00)
View GitHub Profile
@engalar
engalar / x6s.txt
Last active November 3, 2017 06:07
ubuntu install
sudo -H mkdir /mnt/e
sudo -H mkdir /mnt/d
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
@engalar
engalar / waya-dl-setup.sh
Last active November 1, 2017 13:45 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
echo CUDA_REPO_PKG
if [ -f ${CUDA_REPO_PKG} ]; then
echo 'use cache'
fi
if [ ! -f ${CUDA_REPO_PKG} ]; then
using System;
using System.IO;
using Microsoft.Office.Interop.Excel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace CSharpUnitTestProject1
{
[TestClass]
public class DataProcessTest
{
Sub lab()
For Each col In ActiveSheet.UsedRange
For Each c In col
If c.Row > 4 And c.Column > 3 Then
Debug.Print c
@engalar
engalar / test.lsp
Last active April 29, 2016 10:24
autocad lisp
(defun c:lsp ()
(prompt "\n load lisp app and call xdd ...")
;;; (setq lspname (getstring "\nENTER LSP FILENAME:> "))
(load "C:\\Users\\atv023\\Desktop\\tmp.lsp")
(prompt "\n load success ...")
(prompt "\n call .XDD ...")
(c:xdd)
)
'IMPORTANT - CHANGE gtExampleLoad() to include gtDoit() for each Gist you want to load
' bootstrap code to update VBA modules from gists
' all code is in this module - so no classes etc.
' latebinding is used to avoid need for any references
' can be found at https://gist.github.com/3403537
Option Explicit
' v2.04 - 3403537
' if you are using your own gists - change this
Const gistOwner = "brucemcpherson"
@engalar
engalar / gist:6619202
Created September 19, 2013 04:41
经纬度计算距离宏
'计算两经纬度之间距离=cal_long_lat(经度1,纬度1,经度2,纬度2)
Public Function Cal_Long_Lat(ByVal long1 As Double, ByVal lat1 As Double, ByVal long2 As Double, ByVal lat2 As Double) As Double
Const PI As Double = 3.1415926535
Dim AngleLong1, AngleLat1, AngleLong2, AngleLat2 As Double
AngleLong1 = long1 * PI / 180
AngleLat1 = lat1 * PI / 180
AngleLong2 = long2 * PI / 180
AngleLat2 = lat2 * PI / 180
@engalar
engalar / sdf
Last active December 20, 2015 16:59
Public Sub cc()'''wshom.ocx
Dim WshShell As WshShell, bKey
Set WshShell = CreateObject("WScript.Shell")
'WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\", 1, "REG_BINARY"
'WshShell.RegWrite "HKCU\Software\ACME\FortuneTeller\MindReader", "Goocher!", "REG_SZ"
Debug.Print WshShell.RegRead("HKCU\Software\FinePrint Software\pdfFactory4\FinePrinters\pdfFactory Pro\PrinterDriverData\ShowDlg")
Debug.Print WshShell.RegRead("HKCU\Software\FinePrint Software\pdfFactory4\FinePrinters\pdfFactory Pro\PrinterDriverData\PdfAction")
'Debug.Print WshShell.RegRead("HKCU\Software\FinePrint Software\pdfFactory4\OutputFile")
@engalar
engalar / CAD打图脚本
Last active December 20, 2015 14:49
autocad vba print
Public Sub 打印当前()
Dim acadApp As AcadApplication, objDoc As AcadDocument
On Error Resume Next
@echo off
es.exe %*
python etpclient.py -s 192.168.1.56 -t 210 %*
REM more computers running Everything ETP server ...