Skip to content

Instantly share code, notes, and snippets.

@geekmanager
geekmanager / make-git-use-sublime.markdown
Last active June 14, 2024 10:11
Making git use Sublime Text for rebase etc

Making git use Sublime Text

First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to subl which is the launcher from terminal:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

(added bonus of this approach is when you upgrade to ST3 or change text editor, you can just redirect the symlink).

If there's any chance that bash doesn't check usr/local/bin then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen.

module.exports = function dataCyLoader(source) {
var dataAttr= 'data-cy=\"([^"]*)\"';
if(source.match(dataAttr)){
source = source.replace(new RegExp(dataAttr, 'g'), '');
}
return source;
}
@tanaikech
tanaikech / submit.md
Last active March 14, 2024 18:55
Enhanced makeCopy() using Google Apps Script

Enhanced makeCopy() using Google Apps Script

Overview

This is sample scripts for copying files to a specific folder in Google Drive using Google Apps Script (GAS).

Description

When the files in Google Drive are copied to a specific folder using GAS, most users will use makeCopy(destination). When the files are copied using makeCopy(), you might have already noticed that only the standalone projects cannot be copied to the specific folder. They are copied to the root folder (My Drive). Also this situation can be also seen even when "copy" of Drive API v2 and v3 is used. I think that this might be a bug. So I would like to introduce 2 sample scripts as the workaround. In the workaround, it uses Drive API.

Sample script 1

This sample is very simple.

@abdallahokasha
abdallahokasha / Install_robo3t_Ubuntu.md
Last active September 24, 2023 14:54
Install Robo3t on Ubuntu18.04 and make a desktop icon for it

Install Robo3t On Ubuntu 18.04

Download the package form Robo3t or using wget
wget https://download.robomongo.org/1.2.1/linux/robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz
Extract here using

tar -xvzf robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz

@kosso
kosso / index.php
Created October 17, 2019 16:19
Proxy script for Shoutcast audio streams.
<?php
// Proxy script for Shoutcast audio streams.
// Overcomes the CORS issue when using JavaScript to fetch streams for playback and analysis.
// Also http > https
/*
// .htaccess file
// eg: index.php and .htaccess in /radio on your host.
// Point JS/fetch to https://yourhost/radio/audio.mp3 (or any made-up .mp3 name)