Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// LZW-compress a string | |
function lzw_encode(s) { | |
var dict = {}; | |
var data = (s + "").split(""); | |
var out = []; | |
var currChar; | |
var phrase = data[0]; | |
var code = 256; | |
for (var i=1; i<data.length; i++) { | |
currChar=data[i]; |
#!/bin/bash | |
# | |
# Scales down (or up) a video to 720p, re-encoding it as MPEG4. | |
# | |
# Useful as a Nautilus Script in Gnome. | |
# | |
# https://help.ubuntu.com/community/AndroidVideoEncoding#Expert mode: Using ffmpeg (command line) | |
ffmpeg -strict experimental -i "$1" -s 1280x720 -vcodec mpeg4 -b 3000k -acodec aac -ac 1 -ar 16000 -r 13 -ab 64000 "$1.shrinked.mp4" |
// Implements multipart/form-data POST in C# http://www.ietf.org/rfc/rfc2388.txt | |
// http://www.briangrinstead.com/blog/multipart-form-post-in-c | |
public static class FormUpload | |
{ | |
private static readonly Encoding encoding = Encoding.UTF8; | |
public static HttpWebResponse MultipartFormDataPost(string postUrl, string userAgent, Dictionary<string, object> postParameters) | |
{ | |
string formDataBoundary = String.Format("----------{0:N}", Guid.NewGuid()); | |
string contentType = "multipart/form-data; boundary=" + formDataBoundary; |
if (EomAppCommon.Settings.DebugEomDatabase) | |
{ | |
var form = new System.Windows.Forms.Form(); | |
var grid = new System.Windows.Forms.DataGridView { | |
AutoGenerateColumns = true, | |
Dock = System.Windows.Forms.DockStyle.Fill, | |
DataSource = | |
(from c in new [] { | |
Tuple.Create("DADatabaseR1ConnectionString", this.DADatabaseR1ConnectionString), | |
Tuple.Create("StatsYear", this.StatsYear.ToString()), |
public interface IHttpMessageSerializer | |
{ | |
void Serialize(HttpResponseMessage response, Stream stream); | |
void Serialize(HttpRequestMessage request, Stream stream); | |
HttpResponseMessage DeserializeToResponse(Stream stream); | |
HttpRequestMessage DeserializeToRequest(Stream stream); | |
} | |
public class MessageContentHttpMessageSerializer : IHttpMessageSerializer |
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
# A list of available STUN server. | |
stun.l.google.com:19302 | |
stun1.l.google.com:19302 | |
stun2.l.google.com:19302 | |
stun3.l.google.com:19302 | |
stun4.l.google.com:19302 | |
stun01.sipphone.com | |
stun.ekiga.net |
using System; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
namespace ExampleSimpleWebserver | |
{ | |
class Program | |
{ | |
static void Main (string[] args) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<%@ WebHandler Language="C#" Class="PassThruProxy" Debug="true" %> | |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Text; | |
using System.Web; | |
/** | |
* <summary><c>PassThruProxy</c> is a simple pass-through proxy interface for C#.NET (IIS Servers).</summary> |
Reference: | |
Created by Redo The Web | |
http://redotheweb.com/2013/05/15/client-side-full-text-search-in-css.html |