Skip to content

Instantly share code, notes, and snippets.

View ecrider's full-sized avatar
:dependabot:
my story seems to come to an end

Kuba Paczyński ecrider

:dependabot:
my story seems to come to an end
View GitHub Profile
@ecrider
ecrider / php_curl_download_repos.php
Last active March 18, 2024 03:45
Download repos with PHP and cURL from GitHub API as zip/tarball
<?php
/**
* Wasted half my evening trying to get this done.
* Those seems to be the only settings that works for
* downloading large repositories as zip/tarball
* from GitHub with PHP and cURL.
*
* If you don't have to use PHP, then use cURL direcly:
* curl -L -v -H "Authorization: token PERSONAL_ACCESS_TOKEN" https://api.github.com/repos/SOME_USER/SOME_REPO/zipball > dooone.zip
*/
@ecrider
ecrider / throttle.js
Created December 4, 2017 00:46
Throttles execution of any given function - without initial delays
/**
* Throttles execution of given function
* @param {function} func - function to execute
* @param {number} delay - delay in milisecionds
* @param {object} scope - optional scope in which function will be executed
*/
var throttle = function(func, delay, scope) {
var delay = delay || 500;
var scope = scope || this;
var busy = false;
@ecrider
ecrider / polyfillmeup.html
Last active November 22, 2017 19:52
Automatic polyfill
<!--source-->
<script type="text/javascript">
(function(){
if (!(
"Promise" in window &&
"fetch" in window &&
"assign" in Object &&
"keys" in Object
)) {
var polyfill = document.createElement("script");