Skip to content

Instantly share code, notes, and snippets.

View Tusko's full-sized avatar

Tusko Trush Tusko

View GitHub Profile
export const getThumbnail = (id, size = 300) =>
`https://drive.google.com/thumbnail?id=${id}&sz=${size}`;
export const getIcon = (mimeType) =>
`https://drive-thirdparty.googleusercontent.com/256/type/${mimeType}`;
export const getFile = (id) => `https://drive.google.com/uc?id=${id}`;
const downloadFile = (id) =>
@Tusko
Tusko / LICENSE
Created September 2, 2020 11:15 — forked from engelfrost/LICENSE
Fake localStorage. Useful for Safari Private Browsing and browsers that don't implement localStorage.
The MIT License (MIT)
Copyright (c) 2015 Textalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Tusko
Tusko / bower.json
Created March 17, 2020 12:18 — forked from marchrius/bower.json
Load Google Maps API using jQuery Deferred.
{
"name": "load-google-maps",
"version": "1.0.0",
"authors": ["Glenn Baker", "Gavin Foley", "Matteo Gaggiano"],
"description": "Load Google Maps API using jQuery Deferred.",
"main": "load-google-maps.js",
"keywords": ["Google Maps", "Async"],
"license": ["MIT", "GPL"],
"dependencies": {
"jquery": ">=1.5"
@Tusko
Tusko / dom-helper.js
Created October 16, 2018 18:14 — forked from LasMD/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
@Tusko
Tusko / loadPosts.js
Last active December 2, 2017 01:40 — forked from moskalukigor/functions.php
Wordpress Ajax
//JS
var ajaxcontent = $('.products');
$.ajax({
type: 'POST',
url: window.wp_data.ajax_url,
data: {
action: "loadPosts",
},
success: function (html) {
@Tusko
Tusko / functions.php
Created December 7, 2016 13:57 — forked from moskalukigor/functions.php
scheduler wp
add_action('init', 'apiSynchronization_activation');
function apiSynchronization_activation(){
if ( !wp_next_scheduled( 'apiSynchronization' ) ) {
wp_schedule_event( time(), 'twicedaily', 'apiSynchronization');
}
}
add_action('apiSynchronization', 'apiSync', 100);
function apiSync()
{
@Tusko
Tusko / ifix.scss
Last active June 23, 2016 13:53 — forked from jopfre/gist:b8ea1a7ebf39cd8efabb
fix view height support in iOS7
//based on https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
//with added support for iphone 3 and 4 and orinetation support for iphone 5.
//this is for all devices which can run iOS7 in all orientations.
//not a mixin to avoid to much duplicate code when using on multiple selectors.
.selector {
$height: 70; //set your height in vh
$heightPercent: $height/100;
height: #{$height}vh;
@Tusko
Tusko / facebook_page_latest_post_no_php_sdk.php
Last active October 13, 2016 14:26 — forked from biojazzard/facebook_page_latest_post_no_php_sdk.php
Get Latest Post From a Facebook Page without PHP SDK (Graph Version v2.5)
<?php
/*
1.- Create an App.
2.- Go to: https://developers.facebook.com/tools/explorer/
+ Select your new created app on the right top.
+ Select "Get App Token"