Skip to content

Instantly share code, notes, and snippets.

@lsissoko
lsissoko / gradle-java-16.md
Last active July 19, 2021 03:28
upgrade a gradle project from java 8 to 16

navigate to your project root

cd <your-project-dir>

NOTE: i'm using sdkman to manage my java and gradle versions

install java 16

sdk install java 16.0.0-zulu
@lsissoko
lsissoko / clean.sh
Created July 8, 2021 02:51 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
{
"auto_complete_commit_on_tab": true,
"binary_file_patterns":
[
"*.dds",
"*.eot",
"*.gif",
"*.ico",
"*.jar",
"*.jpeg",
@lsissoko
lsissoko / firefox-developer-edition.md
Last active April 10, 2020 12:46 — forked from mahammad/firefox-developer-edition.md
How To install Firefox Developer Edition and create desktop icon for Ubuntu 14.04 LTS

chose other install way

  1. Open Terminal Ctrl+Alt+T Download Firefox Developer Edition tar file

    wget https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=linux64&lang=en-US

  2. Copy tar file to opt sudo cp -rp firefox-35.0a2.en-US.linux-x86_64.tar.bz2

  3. Open opt folder (cd /opt/) and untar file sudo tar xjf firefox-35.0a2.en-US.linux-x86_64.tar.bz2

@lsissoko
lsissoko / hostgator-scp.md
Last active May 16, 2021 15:49
Hostgator SCP

Copy from local to Hostgator

scp -qr -P 2222 -o PubkeyAuthentication=no <source> username@host:<destination>

Copy from Hostgator to local

scp -qr -P 2222 -o PubkeyAuthentication=no username@host:

@lsissoko
lsissoko / gist:f8e47aa81edfbffff8fa
Last active November 16, 2015 14:30
thoughtbot/paperclip Image Validation

When attaching a file in a Rails app via Paperclip, you may get an error like:

Validation failed: Image has an extension that does not match its contents

To resolve this, create the file config/initilizers/paperclip.rb and then restart your server.

#config/initilizers/paperclip.rb
require 'paperclip/media_type_spoof_detector'
module Paperclip
@lsissoko
lsissoko / instagram-file-download.md
Last active December 7, 2017 12:24
How to download an image/video from an Instagram post.

Simple way to get an Instagram post's media source.

  1. Go to the page you want to download from.

  2. Open your browser's dev console (e.g. Ctrl+Shift+J in Chrome on Windows/Linux).

  3. Run the following code in the console to print the image/video URL to the console.

    $('.lfFrame.Frame.Image').attr('src')          // image (option 1)
    $('meta[property="og:image"]').attr('content') // image (option 2)