Skip to content

Instantly share code, notes, and snippets.

View flangofas's full-sized avatar
🎯
Focusing

Antonis Flangofas flangofas

🎯
Focusing
View GitHub Profile
@zobayer1
zobayer1 / fedora_post_install.md
Last active April 4, 2024 12:06
Fedora 36 post installation notes for software developers. Things you should do after installing your new Fedora 36 workstation.

Fedora 36 Post Installation (For Software Developers)

Top N things you should do after installing or upgrading to your new Fedora 36 workstation.


Settings

Change Hostname

@squarism
squarism / iterm2.md
Last active May 1, 2024 15:40
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@rbotzer
rbotzer / multiple-php-versions-os-x.md
Last active July 31, 2017 09:26
Installing PHP versions on Mac OS X Mavericks (10.9)

Installing PHP versions on Mac OS X Mavericks (10.9+) and Higher

Using Homebrew, Homebrew-PHP and the RVM-like brew-php-switcher you can easily switch between multiple installed versions of PHP on your OS X machine (Mavericks 10.9 to El-Capitan 10.11).

Install the command line tools

    xcode-select --install # install the command line tools, if missing

Install Homebrew

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    brew update && brew doctor
@flangofas
flangofas / ConvertMS.js
Last active February 29, 2024 17:22
JS: Convert Milliseconds to days? minutes? seconds? or all!
function convertMiliseconds(miliseconds, format) {
var days, hours, minutes, seconds, total_hours, total_minutes, total_seconds;
total_seconds = parseInt(Math.floor(miliseconds / 1000));
total_minutes = parseInt(Math.floor(total_seconds / 60));
total_hours = parseInt(Math.floor(total_minutes / 60));
days = parseInt(Math.floor(total_hours / 24));
seconds = parseInt(total_seconds % 60);
minutes = parseInt(total_minutes % 60);
@subfuzion
subfuzion / mysql-autostart-osx.md
Created March 18, 2014 22:39
mysql auto start on OS X

Install with Homebrew

brew install mysql

Set up launchctl to auto start mysql

$ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

/usr/local/opt/mysql/ is a symlink to /usr/local/Cellar/mysql/x.y.z (e.g., 5.6.16)

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@danielbwa
danielbwa / list_and_download_files_through_sftp_with_php.php
Last active November 16, 2022 09:38
List and download all files in a directory through sftp with php / ssh2. In my example i use scandir to list the files and ssh2_scp_recv to grab a file. I've found a lot of examples using fopen to grab the remote file, that didn't work for me and i found the code below cleaner than the fopen option. For an example on how to do the same as my exa…
<?php
$username = "your_username";
$password = "your_pass";
$url = 'your_stp_server_url';
// Make our connection
$connection = ssh2_connect($url);
// Authenticate
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@maxrice
maxrice / class-ftp-implicit-ssl-tls.php
Created January 16, 2013 03:11
Basic class to connect to an FTP server with Implicit SSL/TLS and upload a file
<?php
/**
* FTP with Implicit SSL/TLS Class
*
* Simple wrapper for cURL functions to transfer an ASCII file over FTP with implicit SSL/TLS
*
* @category Class
* @author Max Rice
* @since 1.0
*/