Skip to content

Instantly share code, notes, and snippets.

View onigetoc's full-sized avatar

Gino onigetoc

View GitHub Profile
@onigetoc
onigetoc / githack.js
Created October 13, 2022 01:13 — forked from martianyi/githack.js
bookmarklet to view file in raw.githack.com
javascript:(function() {
"use strict";
var TEMPLATES = [
[/^(https?):\/\/gitlab\.com\/([^\/]+\/[^\/]+)\/(?:raw|blob)\/(.+\..+?)(?:\?.*)?$/i, '$1://gl.githack.com/$2/raw/$3'],
[/^(https?):\/\/bitbucket\.org\/([^\/]+\/[^\/]+)\/(?:raw|src)\/(.+\..+?)(?:\?.*)?$/i, '$1://bb.githack.com/$2/raw/$3'],
[/^(https?):\/\/bitbucket\.org\/snippets\/([^\/]+\/[^\/]+)\/revisions\/([^\/\#\?]+)(?:\?[^#]*)?(?:\#file-(.+\..+?))$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/$3/files/$4'],
[/^(https?):\/\/bitbucket\.org\/snippets\/([^\/]+\/[^\/\#\?]+)(?:\?[^#]*)?(?:\#file-(.+\..+?))$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/HEAD/files/$3'],
[/^(https?):\/\/bitbucket\.org\/\!api\/2.0\/snippets\/([^\/]+\/[^\/]+\/[^\/]+)\/files\/(.+\..+?)(?:\?.*)?$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/files/$3'],
[/^(https?):\/\/api\.bitbucket\.org\/2.0\/snippets\/([^\/]+\/[^\/]+\/[^\/]+)\/files\/(.+\..+?)(?:\?.*)?$/i, '$1://bb.githack.com/!api/2.0/snippets/$2/files/$3'],
[/^(
{ "categories" :
[ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
@onigetoc
onigetoc / Materialize-Mobile.html
Last active July 14, 2022 01:57 — forked from TerrenceLP/landing-like-google.html
Materialize CSS Demo Template
Materialize-Mobile.html
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!--Let browser know website is optimized for mobile-->
@onigetoc
onigetoc / countries.json
Created July 12, 2022 22:28 — forked from tiagodealmeida/countries.json
List of countries with country code, name, currency code, population, capital and continent name in JSON format
{
"countries": {
"country": [
{
"countryCode": "AD",
"countryName": "Andorra",
"currencyCode": "EUR",
"population": "84000",
"capital": "Andorra la Vella",
"continentName": "Europe"
@onigetoc
onigetoc / hex-to-bgr.js
Created March 8, 2022 01:36 — forked from Maqsim/hex-to-bgr.js
HEX to BGR
'#ff2233'.substr(1).match(/.{2}/g).reverse().join('')
@onigetoc
onigetoc / wp-ajax-loadmore.md
Created October 5, 2020 16:02 — forked from aslamdoctor/wp-ajax-loadmore.md
Wordpress - AJAX Load More Steps

Step 1. Load more button

<?php
global $wp_query; // you can remove this line if everything works for you
 
// don't display the button if there are not enough posts
if (  $wp_query->max_num_pages > 1 )
	echo '<div class="misha_loadmore">More posts</div>'; // you can use <a> as well
?>
@onigetoc
onigetoc / app-code.js
Created September 29, 2020 04:21 — forked from timhudson/app-code.js
Scroll start/stop events using jQuery
$(function() {
$(document).on('scrollstart', function() {
console.log('scroll started')
})
$(document).on('scrollend', function() {
console.log('scroll ended')
})
@onigetoc
onigetoc / providers.json
Created September 28, 2020 22:01 — forked from Niklan/providers.json
Copy of https://oembed.com/providers.json which blocked in Russia. Used for mirroring.
[
{
"provider_name": "23HQ",
"provider_url": "http:\/\/www.23hq.com",
"endpoints": [
{
"schemes": [
"http:\/\/www.23hq.com\/*\/photo\/*"
],
"url": "http:\/\/www.23hq.com\/23\/oembed"
@onigetoc
onigetoc / es7-async-await.js
Created February 13, 2020 00:11 — forked from msmfsd/es7-async-await.js
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved