Skip to content

Instantly share code, notes, and snippets.

View emilioeduardob's full-sized avatar
🏠
Working from 🇵🇾

Emilio Blanco emilioeduardob

🏠
Working from 🇵🇾
View GitHub Profile
@JamesWatling
JamesWatling / gist:ef37e683c2f92cb576e90f9848422c06
Created September 13, 2024 00:03
Delete all local branches more than a month old that don't contain prod/staging/release/main with confirmation
#!/bin/bash
# Function to check branch age and filter out excluded branches
get_old_branches() {
git for-each-ref --sort=-committerdate refs/$1/ \
--format='%(refname:short)' \
| grep -v -E '(prod|staging|release|main)' \
| xargs -n 1 -I {} git log -1 --format="%ci {}" {} \
| awk -v date="$(date -v-30d +%Y-%m-%d)" '$1 <= date {print $4}'
}
@jjsquady
jjsquady / nextjs-deploy.md
Last active September 19, 2024 06:16
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@jk2K
jk2K / extract_realm_database_android.sh
Last active February 22, 2023 15:04 — forked from medyo/extract_realm_database_android.sh
how to export realm database, work on Android 5.0+
#!/bin/bash
ADB_PATH="/Users/lee/Library/Android/sdk/platform-tools"
PACKAGE_NAME="com.yourcompany.app"
DB_NAME="default.realm"
DESTINATION_PATH="/Users/lee/Downloads/${DB_NAME}"
NOT_PRESENT="List of devices attached"
ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'`
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then
echo "Make sure a device is connected"
else
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
anonymous
anonymous / Add to values, colors.xml
Created August 5, 2014 18:04
Action Bar Styling
<color name="sunshine_blue">#ff1ca8f4</color>
@staltz
staltz / introrx.md
Last active September 16, 2024 07:18
The introduction to Reactive Programming you've been missing
@blackjid
blackjid / gulpfile.js
Created April 9, 2014 17:59
Gulp Ionic Server + Livereload + Proxy
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var connect = require('gulp-connect');
var paths = {
css: ['./www/css/**/*.css'],
js: ['./www/js/**/*.js'],
@wbroek
wbroek / genymotionwithplay.txt
Last active August 12, 2024 07:34
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@bhaberer
bhaberer / submodule_strategy.rb
Last active January 29, 2019 20:13 — forked from stevenscg/submodule_strategy.rb
Capistrano 3.1.x Strategy to deploy git projects with submodules.
# Usage:
# 1. Drop this file into lib/capistrano/submodule_strategy.rb
# 2. Add the following to your Capfile:
# require 'capistrano/git'
# require './lib/capistrano/submodule_strategy'
# 3. Add the following to your config/deploy.rb
# set :git_strategy, SubmoduleStrategy
module SubmoduleStrategy
# do all the things a normal capistrano git session would do