Skip to content

Instantly share code, notes, and snippets.

View 19317362's full-sized avatar

david.wang 19317362

View GitHub Profile
@19317362
19317362 / gb2312-utf8-convert.js
Created January 12, 2016 06:20 — forked from fwolf/gb2312-utf8-convert.js
Convert between gb2312 and utf8 using javascript
http://freecode-freecode.blogspot.com/2008/11/how-to-gbkgb2312-and-utf-8-encoding.html
GB2312UTF8 = {
Dig2Dec : function(s){
var retV = 0;
if(s.length == 4){
for(var i = 0; i < 4; i ++){
retV += eval(s.charAt(i)) * Math.pow(2, 3 - i);
}
return retV;
@19317362
19317362 / socket.io.cs
Created June 3, 2016 23:42 — forked from prabirshrestha/socket.io.cs
socket.io 4 .net
namespace WebSocketHelloEchoServer.SocketIo
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.WebSockets;
using System.Reflection;
@19317362
19317362 / .gitignore
Created October 17, 2016 05:51 — forked from rjmunro/.gitignore
gitignore for cordova cli projects
# Android
platforms/android/assets/www
platforms/android/bin/
platforms/android/gen/
platforms/android/res/xml/config.xml
# iOS
platforms/ios/build/
platforms/ios/CordovaLib/build/
platforms/ios/www
@19317362
19317362 / TaskHelpers.cs
Created March 26, 2017 15:08 — forked from itsff/TaskHelpers.cs
Extensions for Task Parallel Library from ASP.NET MVC project.
/*
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
Microsoft Open Technologies would like to thank its contributors, a list
of whom are at http://aspnetwebstack.codeplex.com/wikipage?title=Contributors.
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@19317362
19317362 / asp.net MVC jqGrid model
Created April 19, 2017 20:52
Strongly typed asp.net MVC model for jqGrid in C#
namespace CodeFirst.Models
{
public class Column
{
public string name { get; set; }
public string index { get; set; }
public int width { get; set; }
public string align { get; set; }
public Column(string _name, string _index)
@19317362
19317362 / 030_update_platform_config.js
Created May 21, 2017 03:31 — forked from marcocarnazzo/030_update_platform_config.js
Ionic/Cordova update platform config
#!/usr/bin/env node
/** This hook updates platform configuration files based on preferences and config-file data defined in config.xml.
Currently only the AndroidManifest.xml and IOS *-Info.plist file are supported.
See http://stackoverflow.com/questions/28198983/ionic-cordova-add-intent-filter-using-config-xml
Preferences:
1. Preferences defined outside of the platform element will apply to all platforms
2. Preferences defined inside a platform element will apply only to the specified platform
@19317362
19317362 / gist:d37fbf4131dba1e079b210fd3563ef7e
Created May 4, 2018 01:26 — forked from philipn/gist:5274197
Running Ubuntu on a Macbook Air

Running Ubuntu on a Macbook Air

You don't have to be a slave to OS X! Here's a guide to a sane dual-booting setup with Ubuntu 12.10 on your shiny MacBook Air. This is written and tested for a MacBook Air 5,2 (Mid 2012), but likely works the same with any modern Macbook.

Install according to instructions at this URL:

@19317362
19317362 / installantoncentos.sh
Last active October 14, 2022 18:24 — forked from parzonka/installantoncentos.sh
How to install ant on centos
# download and install
antversion=1.10.3
wget http://archive.apache.org/dist/ant/binaries/apache-ant-${antversion}-bin.tar.gz
sudo tar xvfvz apache-ant-${antversion}-bin.tar.gz -C /opt
sudo ln -sfn /opt/apache-ant-${antversion} /opt/ant
sudo sh -c 'echo ANT_HOME=/opt/ant >> /etc/environment'
sudo ln -sfn /opt/ant/bin/ant /usr/bin/ant
# check installation
ant -version
@19317362
19317362 / pre-commit-clang-format
Created August 15, 2018 02:31 — forked from wangkuiyi/pre-commit-clang-format
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by rene.milk@wwu.de
# This file is part of a set of unofficial pre-commit hooks available
# at github.
@19317362
19317362 / C++ Install gSOAP.txt
Created November 22, 2018 03:55 — forked from callemall/C++ Install gSOAP.txt
Install gSOAP for using C++ programs to access a SOAP API. Install from an account that has appropriate system privileges.
wget http://sourceforge.net/projects/gsoap2/files/gSOAP/gsoap_2.8.1.zip/download
unzip gsoap_2.8.1.zip
cd gsoap-2.8/
./configure --prefix=/usr
make
make install