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
// Ref: https://github.com/umdjs/umd/blob/master/templates/amdWeb.js
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['moduleName'], factory);
} else {
root.moduleName = factory(root.moduleName);
}
}(this, function(moduleName) {
'use strict';
@J2TEAM
J2TEAM / Tinypng-download-all.js
Last active February 13, 2017 07:12
Script to download all images on tinypng.com
var result = document.querySelector('.results'),
links = result.querySelectorAll('.after > a'),
t = links.length,
output = '';
for (var i = 0; i < t; i++) {
output += links[i].href + "\n";
}
copy(output); // This command only work on Chrome
@J2TEAM
J2TEAM / Jarvis.py
Created February 25, 2016 13:17 — forked from GGulati/Jarvis.py
import speech_recognition
import pyttsx
speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init
speech_engine.setProperty('rate', 150)
def speak(text):
speech_engine.say(text)
speech_engine.runAndWait()
@J2TEAM
J2TEAM / AND_OR_NOT
Created March 1, 2016 05:19 — forked from oliverdoetsch/AND_OR_NOT
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@J2TEAM
J2TEAM / Blogger-random-post-2.js
Last active May 30, 2018 23:45
Get a random post by using Blogger Feeds API.
function getRandomPost(t){var o=t.feed.entry,n=o[Math.floor(Math.random()*o.length)];window.top.location.href=n.link[4].href}function loadScript(t){var o,n=document.getElementsByTagName("script")[0];o=document.createElement("script"),o.src=t,n.parentNode.insertBefore(o,n)}function randomButtonHandle(){var t=window.top.location,o=t.protocol+"//"+t.hostname+"/feeds/posts/default?alt=json-in-script&max-results=100&callback=getRandomPost";loadScript(o)}randomButtonHandle();
@J2TEAM
J2TEAM / Google-Analytics-Favicon.js
Last active October 18, 2018 19:25
Google Analytics Bookmarklets
javascript:!function(){var e=0,n=0,t=5,o="http://themushroomkingdom.net/sounds/wav/",u=new Audio(o+"smw/smw_1-up.wav"),a=new Audio(o+"smw/smw_stomp_no_damage.wav"),r=new Audio(o+"smb/smb_1-up.wav"),i=new Audio(o+"smb/smb_gameover.wav"),m=function(e){currentCount=parseInt(document.getElementById("ID-overviewCounterValue").innerHTML);var o=currentCount-e;console.log(o),o>0&&u.play(),0>o&&a.play(),o>0&&currentCount>=n+t&&r.play(),0>o&&0==currentCount&&(i.play(),n=0),e=currentCount,currentCount>=n+t&&(n+=t),setTimeout(function(){m(e)},1e3)},c=function(){var e=parseInt(document.getElementById("ID-overviewCounterValue").innerText);[].slice.call(document.querySelectorAll("link[type='image/x-icon']")).forEach(function(e){e.parentNode.removeChild(e)});var n=document.createElement("canvas");n.width=16,n.height=16;var t=n.getContext("2d"),o=function(){t.font="bold 10px sans-serif",t.fillText(e,e>9?2:4,12);var o=document.createElement("link");o.type="image/x-icon",o.rel="shortcut icon",o.href=n.toDataURL("image/x-icon"),
@J2TEAM
J2TEAM / blogspot-prevent-redirect-to-country-domains.js
Created April 10, 2016 13:25
Fix redirects to a country-specific URL problem (author: Amit Agarwal)
<script>//<![CDATA[
var blogUrl=window.top.location.href.toLowerCase();blogUrl.indexOf(".blogspot.com")===-1&&(blogUrl=blogUrl.replace(/\.blogspot\..*?\//,".blogspot.com/ncr/"),window.top.location.replace(blogUrl));
//]]></script>
@J2TEAM
J2TEAM / hosts
Created April 11, 2016 09:26
Fix TeamViewer connection error
# TeamViewer server list - created by Juno_okyo
92.51.156.68 server10001.teamviewer.com
92.51.156.70 server10002.teamviewer.com
92.51.156.72 server10003.teamviewer.com
92.51.156.74 server10004.teamviewer.com
92.51.156.76 server10005.teamviewer.com
92.51.156.80 server10007.teamviewer.com
92.51.156.84 server10009.teamviewer.com
92.51.156.88 server10011.teamviewer.com
92.51.156.92 server10013.teamviewer.com
@J2TEAM
J2TEAM / dumprequest.php
Created April 13, 2016 04:17 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method/HTTP headers and request body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
@J2TEAM
J2TEAM / config.json
Created April 13, 2016 06:58 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",