Skip to content

Instantly share code, notes, and snippets.

@eerohele
eerohele / mosh-cygwin.md
Last active March 3, 2024 04:20
Compiling Mosh (http://mosh.mit.edu/) under Cygwin

NOTE: You don't need to compile Mosh on Cygwin yourself anymore; just install the package with Cygwin's setup.exe.

  1. Download Cygwin.

  2. Run setup.exe and install the following packages in addition to the default ones:

    • make
    • boost
    • libncurses-devel
    • pkg-config
  • perl
@davidortinau
davidortinau / View.cs
Created April 29, 2012 01:27
Detect Single Tap on UIWebView
namespace App.iOS
{
public partial class PaperView : UIViewController
{
// webView is a UIWebView
// toolbar is a UIToolbar
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
@lytsing
lytsing / sina-shorten-url.rb
Created September 21, 2012 07:52
Make long url into short url from http://t.cn
#!/usr/bin/ruby
#
# encoding: utf-8
#
# Make long url into short url from http://t.cn
#
require "uri"
require "net/http"
params = {
@suziewong
suziewong / git.md
Last active February 19, 2023 05:38
Git的多账号如何处理? 1.同一台电脑多个git(不同网站的)账号 2.同一台电脑多个git(同一个网站的比如github的)多个账号

1.同一台电脑可以有2个git账号(不同网站的)

首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)

host github
  hostname github.com
  Port 22

host gitlab.zjut.com

# Mousemode alias so the mouse works in WeeChat while running mosh:
alias mousemode="perl -E ' print \"\e[?1005h\e[?1002h\" '"
# Command function to enable mousemode, get the mosh key and port, lookup the ip for the hostname and set up the mosh-client connection
function mosher() {
mousemode
mosh_string=$(ssh $1 -t mosh-server|grep "MOSH CONNECT")
mosh_key=$(echo $mosh_string|cut -d " " -f4)
mosh_port=$(echo $mosh_string|cut -d " " -f3)
mosh_ip=$(ping -n 1 $1 | grep Pinging | cut -d '[' -f 2|cut -d ']' -f 1)
@mnpenner
mnpenner / mode-mysql.js
Created April 16, 2013 02:14
MySQL mode for Ace editor. Based on existing pgsql mode with MySQL keywords and functions.
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@hofmannsven
hofmannsven / README.md
Last active July 3, 2024 09:53
Git CLI Cheatsheet
@sebble
sebble / github.api
Created June 23, 2014 20:43
GitHub, GitLab, Prose.io API comparisons
DELETE /applications/:client_id/tokens
DELETE /applications/:client_id/tokens/:access_token
GET /applications/:client_id/tokens/:access_token
POST /applications/:client_id/tokens/:access_token
GET /authorizations
POST /authorizations
PUT /authorizations/clients/:client_id
DELETE /authorizations/:id
GET /authorizations/:id
PATCH /authorizations/:id
@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing