Skip to content

Instantly share code, notes, and snippets.

View J2TEAM's full-sized avatar
💭
I may be slow to respond.

JUNO_OKYO J2TEAM

💭
I may be slow to respond.
View GitHub Profile
@J2TEAM
J2TEAM / jquery.php
Created April 19, 2016 04:04
Include jQuery based-on user's IE version.
<?php
/**
* jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8.
* All the notes in the jQuery 1.9 Upgrade Guide apply here as well. Since IE 8 is still relatively common,
* we recommend using the 1.x version unless you are certain no IE 6/7/8 users are visiting the site.
*/
function include_jquery() {
if(preg_match('/(?i)msie [6-8]/', $_SERVER['HTTP_USER_AGENT'])) {
// if IE<=8
$version = '1.12.2';
@J2TEAM
J2TEAM / custom-font.au3
Created April 19, 2016 08:46
AutoIt snippets collection
#include <APIGdiConstants.au3>
#include <WinAPIGdi.au3>
_WinAPI_AddFontResourceEx(@ScriptDir & '\HelveticaNeue.ttf', $FR_PRIVATE)
; GUICreate(...)
GUISetFont(12, -1, -1, 'Helvetica Neue')
; GUISetState(@SW_SHOW)
<?php
function remoteFileSize($url) {
stream_context_set_default(
array(
'http' => array(
'method' => 'HEAD'
)
)
);
$headers = get_headers($url, 1);
@J2TEAM
J2TEAM / font_grabber.rb
Created June 11, 2016 10:49 — forked from ttscoff/font_grabber.rb
Give it a <link> from Google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
@J2TEAM
J2TEAM / README.md
Created July 11, 2016 22:35
Deobfuscate free version of JavascriptObfuscator.com

Simple Javascript deobfuscator

Aims to deobfuscate the result of JavascriptObfuscator free version.

Run

To tun the script, you should have had node.js installed first. Requires node.js and following npm modules:

  • esprima
@J2TEAM
J2TEAM / test.py
Created July 24, 2016 02:09 — forked from christianroman/test.py
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@J2TEAM
J2TEAM / captcha-bypass.py
Last active July 24, 2016 02:09 — forked from christianroman/test.py
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@J2TEAM
J2TEAM / imgur-oauth-test.html
Created July 25, 2016 19:19 — forked from eirikb/imgur-oauth-test.html
Post to imgur using oauth (api v3) on a static (no server) site
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>imgur oauth</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(function () {
var extractToken = function(hash) {
#include-once
; Download fciv.exe: https://www.microsoft.com/en-us/download/details.aspx?id=11533
; Author: Juno_okyo
Func _hashFileMD5($filePath)
If FileExists($filePath) Then
Local $output = _GetDOSOutput('C:\fciv.exe "' & $filePath & '"')
$output = StringReplace($output, @CRLF, @CR)
$output = StringReplace($output, @LF, @CR)
@J2TEAM
J2TEAM / m3u8-concat.sh
Created August 25, 2016 20:34 — forked from maxwellito/m3u8-concat.sh
Concat / join .ts segment files into an mp4 file
#!/bin/sh
# This script must be executed in the repo where
# the *.ts files are.
# It will concatenate the segments into one temp
# file which ffmpeg will reencode the audio track.
# By default the ouptup filename is output.mp4
# but can be changed by providing the name as parameter.
#
# ffmpeg is required