Skip to content

Instantly share code, notes, and snippets.

@suziewong
suziewong / tcpdump.md
Last active August 13, 2019 08:31
Tcpdump

Tcpdump

看了蛮久的tcpdump,也一直很想尝试抓包这类的技能。

tcpdump

-i 指定监听网卡 lo eth0
-c 数量
-w xxx.cap(直接是wireshark的2进制文件)

-A ACSII显示内容

@henrik
henrik / rules.md
Last active May 23, 2022 12:31
Sandi Metz' four rules from Ruby Rogues episode 87. Listen or read the transcript: http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/
  1. Your class can be no longer than 100 lines of code.
  2. Your methods can be no longer than five lines of code.
  3. You can pass no more than four parameters and you can’t just make it one big hash.
  4. When a call comes into your Rails controller, you can only instantiate one object to do whatever it is that needs to be done. And your view can only know about one instance variable.

You can break these rules if you can talk your pair into agreeing with you.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 17, 2026 19:56
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@laszlomiklosik
laszlomiklosik / Maven multi-module build options
Created January 28, 2013 07:29
Maven multi-module build options
# Inspired from http://blog.akquinet.de/2010/05/26/mastering-the-maven-command-line-%E2%80%93-reactor-options/
# Build only specific modules:
mvn clean install -pl sub-module-name2
mvn clean install -pl sub-module-name2,sub-module-name3
# Build only starting from specific sub-module (resume from)
mvn clean install -rf sub-module-name2
# Build dependencies (also make)
@groovybayo
groovybayo / step-by-step-gatling-idea.md
Last active October 19, 2025 16:18
Gatling: Step by step guide to IntelliJ integration

Step by step guide to setting up IDEA to write gatling simulations

Prerequisites:

Have [SBT plugin][sbt-plugin] installed

Begin

  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module
@cbumgard
cbumgard / date-range-form.html
Last active January 25, 2016 10:21
Date Range Form with Validation. Live demo: http://jsfiddle.net/chrisbumgardner/VzYQn/2/embedded/result/. Built with jQuery, jQuery UI DatePicker, jQuery Validation, and Zurb Foundation This form allows choosing a date range from any previous day up to and including today's date. When a start date is selected, the end date cannot come before it.…
<br>
<div class="container">
<div class="row">
<div class="six columns">
<h2>Date Range Form</h2>
<h5 class="small">By <a href="https://gist.github.com/cbumgard/4742703" target="_blank">Chris Bumgardner</a></h5>
<h3 class="subheader">Built with <a href="http://jquery.com/" target="_blank">jQuery</a>, <a href="http://api.jqueryui.com/datepicker/" target="_blank">jQuery UI DatePicker</a>, <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery Validation</a>, and <a href="http://foundation.zurb.com/" target="_blank">Zurb Foundation</a></h3>
<h5><a href="http://jsfiddle.net/chrisbumgardner/VzYQn/" target="_blank">See the jsFiddle</a></h5>
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
trait Base {
def companion: MetaBase = {
val classSymbol = cm.classSymbol(getClass)
val moduleSymbol = classSymbol.companionSymbol.asModule
val moduleMirror = cm.reflectModule(moduleSymbol)
moduleMirror.instance.asInstanceOf[MetaBase]
}
@jednano
jednano / gitcom.md
Last active April 28, 2026 14:26
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init
@passy
passy / jade.md
Last active August 17, 2020 09:35
Using Yeoman and Jade

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization

@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active June 8, 2026 04:50
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>