Skip to content

Instantly share code, notes, and snippets.

View JustinTW's full-sized avatar
🎯
Focusing

Justin Liu JustinTW

🎯
Focusing
  • MarsBlockchain
  • Taipei, Taiwan
View GitHub Profile
@sloria
sloria / bobp-python.md
Last active May 12, 2024 06:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@jackgill
jackgill / bundle.js
Last active March 25, 2024 13:53
A node.js script to create a bundle containing an npm package, and all of its dependencies.
/*
* This script will download a package (and all of its dependencies) from the
* online NPM registry, then create a gzip'd tarball containing that package
* and all of its dependencies. This archive can then be copied to a machine
* without internet access and installed using npm.
*
* The idea is pretty simple:
* - npm install [package]
* - rewrite [package]/package.json to copy dependencies to bundleDependencies
* - npm pack [package]
@mattrude
mattrude / changepassword.php
Created October 31, 2010 23:49
LDAP PHP Change Password Page
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
@hardikdangar
hardikdangar / squid.conf
Created March 4, 2017 09:48
squid.conf
# General
http_port 3130
http_port 3128 intercept
https_port 3129 intercept ssl-bump cert=/etc/squid/ssl_cert/srtpl.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
acl DiscoverSNIHost at_step SslBump1
acl NoSSLIntercept ssl::server_name_regex -i "/etc/squid/url.nobump"
ssl_bump splice NoSSLIntercept
ssl_bump peek DiscoverSNIHost
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@nojvek
nojvek / Tinder Auto-liker
Last active November 12, 2021 18:28
Tinder Auto-liker script
<?php
// Licence: WTFPL ! http://www.wtfpl.net/about/
$fbAuth = array("facebook_id" => "123456789", "facebook_token" => "<Use charles proxy to do man-in-middle SSL sniffing and extract fb token>");
// Do the magic.
$tinderToken = tinderCall("auth", "token", $fbAuth); // Authenticate
$authToken = "X-Auth-Token: $tinderToken\r\nAuthorization: Token token=\"$tinderToken\"\r\n";
@sunilmallya
sunilmallya / gist:7573627
Last active June 30, 2021 18:23
Mocking Httpclient and AsyncHttpclient in Tornado Server
#!/usr/bin/env python
'''
Mocking Httpclient and AsyncHttpclient in Tornado Server
'''
import unittest
import urllib
import tornado.gen
import tornado.ioloop
import tornado.web
@stefanbirkner
stefanbirkner / nexusdeb.sh
Last active October 27, 2020 17:30
Nexusdeb build a debian package of the Nexus server.
#!/bin/bash
# nexusdeb builds a debian package of the Nexus repository manager. nexusdeb
# downloads nexus by itself. You run it by
# nexusdeb.sh <version> <maintainer>
# Example:
# nexusdeb.sh 2.0.5 "Denny Colt <d.colt@eisner.qcg>"
#
# The script has been tested with version 2.0.5.
if [ -z $1 ]