Skip to content

Instantly share code, notes, and snippets.

View MaraScott's full-sized avatar
🇪🇺
Maras IT

MaraScott MaraScott

🇪🇺
Maras IT
View GitHub Profile
@MaraScott
MaraScott / gitpushbatch.sh
Created December 10, 2019 21:49 — forked from alexxxdev/gist:1dd024cadea091ca64154f9616d5739a
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
@MaraScott
MaraScott / README.md
Created October 30, 2018 12:07 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
  • List every object at each commit.
@MaraScott
MaraScott / swipe.js
Created October 25, 2017 07:17 — forked from SleepWalker/swipe.js
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@MaraScott
MaraScott / loop_files_folders_recursively.go
Created September 3, 2016 15:53 — forked from francoishill/loop_files_folders_recursively.go
Loop through files and folders recursively in golang
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() ([]string, error) {
searchDir := "c:/path/to/dir"
@MaraScott
MaraScott / AllMimeTypes.php
Last active August 29, 2015 14:20 — forked from plasticbrain/gist:3887245
Name : AllMimeTypes.php - Language : php - type : class - platform : symfony2 - description : all mime types around the world - tag : symfony, mime type, php
<?php
# source : http://www.iana.org/assignments/media-types/media-types.xhtml
# source : https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types
namespace Dwl\Bundle\LegacyBundle\Utils;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\File\File;