Skip to content

Instantly share code, notes, and snippets.

View JaymzZh's full-sized avatar
🎯
Focusing

Jaymz JaymzZh

🎯
Focusing
View GitHub Profile
@TaoK
TaoK / TextFileEncodingDetector.cs
Last active July 21, 2023 08:56
Simple class to automatically detect text file encoding, with English-biased "best guess" heuristic based on byte patterns in the absence of BOM.
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
namespace KlerksSoft
{
public static class TextFileEncodingDetector
{
/*
@chrisnicola
chrisnicola / GzipFilter.cs
Created August 15, 2011 19:36
Gzip Compression Filter for Nancy
/* A JSON gzip compression filter, which could easily be adapted to any pattern needed. This uses a custom AfterFilter
* type which is just a fancy wrapper of Action<NancyContext>. It's useful for convention based loading of filters
*/
public class GzipCompressionFilter : AfterFilter
{
protected override void Handle(NancyContext ctx)
{
if ((ctx.Response.ContentType == "application/json") && ctx.Request.Headers.AcceptEncoding.Any(
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@stamparm
stamparm / output.txt
Last active March 5, 2019 21:44
Sample sqlmap run
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?id=1" -z "ign,flu,bat" --banner -f
sqlmap/1.0-dev-7614c81 - automatic SQL injection and database takeover tool
http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 10:30:49
[10:30:49] [INFO] testing connection to the target url
@priore
priore / gist:7163408
Created October 25, 2013 23:32
ASP.NET [C#] Redirect with post data
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections.Specialized;
using System.Text;
// ASP.NET [C#] REDIRECT WITH POST DATA
public static class WebExtensions
{
@philc
philc / gist:e849b48e6c5f32592d62
Created July 21, 2014 01:05
A script to copy Chrome's search engine settings into Vimium's settings format
#!/bin/sh
# This script lists user defined search engines in Chromium.
# It replaces {inputEncoding}, which appears in some search engine definitions, with
# UTF-8, {google:baseURL} with the Google URL, and omits other such tokens.
# Location of Chromium's 'Web Data' SQLite3 file
CHROMIUM_WEB_DATA="$HOME/.config/chromium/Default/Web Data"
# Location to create temporary copy of 'Web Data', since the database is locked while
@xiangzhuyuan
xiangzhuyuan / python-interview.md
Last active November 19, 2018 10:02
a list questions from here: http://careerride.com/

What is Python? State some programming language features of Python.

Python is a modern powerful interpreted language with objects, modules, threads, exceptions, and automatic memory managements. Python was introduced to the world in the year 1991 by Guido van Rossum Salient features of Python are

  • Simple & Easy: Python is simple language & easy to learn.
  • Free/open source: it means everybody can use python without purchasing license.
  • High level language: when coding in Python one need not worry about low-level details.
  • Portable: Python codes are Machine & platform independent.
  • Extensible: Python program supports usage of C/ C++ codes.
#!/bin/sh
### BEGIN INIT INFO
# Provides: <SCRIPT_NAME>
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Script to run asp.net 5 application in background
### END INIT INFO
@davidfowl
davidfowl / typesafeparams.md
Last active December 14, 2015 01:55
Typesafe params

In the new ASP.NET 5 stack dependency injection is pervasive. We let users wire up their dependencies in the Startup class:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddTransient<IFoo, Foo>();
    }
    
@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD