Skip to content

Instantly share code, notes, and snippets.

View anovsiradj's full-sized avatar

MDMCDC anovsiradj

View GitHub Profile
@kosinix
kosinix / resumable-download.php
Created September 22, 2014 08:46
PHP - resumable download
<?php
class ResumeDownload {
private $file;
private $name;
private $boundary;
private $delay = 0;
private $size = 0;
function __construct($file, $delay = 0) {
if (! is_file($file)) {
@ohryan
ohryan / responsive-align.less
Last active April 30, 2019 17:27
Bootstrap 3 Responsive Text Align
.text-xs-left { text-align: left; }
.text-xs-right { text-align: right; }
.text-xs-center { text-align: center; }
.text-xs-justify { text-align: justify; }
@media (min-width: @screen-sm-min) {
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }
.text-sm-center { text-align: center; }
.text-sm-justify { text-align: justify; }
@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing
@oliverdoetsch
oliverdoetsch / AND_OR_NOT
Last active January 22, 2023 17:03
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
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@rctay
rctay / gist:9829266
Created March 28, 2014 10:01
shuffle/randomize playlist/set tracks in Soundcloud Widget eg. https://w.soundcloud.com/player/?url=http://api.soundcloud.com/users/1539950/favorites
require(["lib/play-manager"], function(a) {
// via http://stackoverflow.com/a/6274381
//+ Jonas Raoni Soares Silva
//@ http://jsfromhell.com/array/shuffle [v1.0]
function shuf(o) { for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); }
shuf(a.source.models);
var c = a.getCurrentSound(), p = c ? c.isPaused() : false;
a.playNext(); a.playPrev(); // poor man's refresh of current playing song
if (p) a.pause(c); // preserve first-run state
@iovar
iovar / proxy.php
Last active February 24, 2024 18:29
Simple PHP Proxy Script
<?php
/*
* Warning! Read and use at your own risk!
*
* This tiny proxy script is completely transparent and it passes
* all requests and headers without any checking of any kind.
* The same happens with JSON data. They are simply forwarded.
*
* This is just an easy and convenient solution for the AJAX
@v-dimitrov
v-dimitrov / touchpad-fix
Last active August 23, 2022 11:00
touchpad fn key fix
#!/bin/sh
# toggle touch pad
device=`xinput list --name-only | grep -i touchpad`
isOn=`xinput list-props "$device" | grep -i enabled | tail -c 2`
iconEnabled='input-touchpad-symbolic'
iconDisabled='touchpad-disabled-symbolic'
case "$isOn" in
0)
@PixnBits
PixnBits / md5.js
Last active May 27, 2022 07:51 — forked from jhoff/md5.js
invalid reference fix
/*
* http://www.myersdaily.org/joseph/javascript/md5-text.html
*/
(function (global) {
var md5cycle = function (x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];
@nmsdvid
nmsdvid / new_gist_file.js
Created February 4, 2014 16:32
Simple JavaScript Debounce Function
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);