View ffmpeg-commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Making gif with PNG files | |
# Generate palette | |
ffmpeg -f image2 -i frame%04d.png -vf scale=900:-1:sws_dither=ed,palettegen palette.png | |
# Join png files using the palette generate | |
ffmpeg -i frame%04d.png -i palette.png -filter_complex "fps=12,scale=900:-1:flags=lanczos[x];[x][1:v]paletteuse" video.gif |
View add_firebase_user.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import hmac | |
import base64 | |
import secrets | |
import json | |
import os | |
print("Create a user account with email and the password is randomly generated.") | |
email = input("Email: ") |
View firebase_livereload.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from livereload import Server | |
from tornado.web import RedirectHandler, StaticFileHandler | |
settings = json.load(open('.firebaserc')) | |
server_url = 'https://%s.web.app/__/' % settings['projects']['default'] | |
class NoCacheHandler(StaticFileHandler): | |
def set_extra_headers(self, path): |
View change_working_directory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web_dir = os.path.join(os.path.dirname(__file__), 'public') | |
os.chdir(web_dir) |
View android_gems.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snackbar: small notifications shows at the bottom |
View usbcore_parameters.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/default/grub | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.usbfs_memory_mb=1000 usbcore.autosuspend=-1" | |
sudo update-grub |
View esp32_ble_keyboard.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Based on this gist https://gist.github.com/sabas1080/93115fb66e09c9b40e5857a19f3e7787 | |
Minor modifications | |
*/ | |
#include <BLEServer.h> | |
#include <BLEDevice.h> | |
#include <BLEHIDDevice.h> | |
#include <BLE2902.h> |
View ec2_ami_linux_2_installation.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum update | |
# call amazon-linux-extras to view what packages are available | |
sudo amazon-linux-extras install nginx1 | |
sudo systemctl enable nginx.service | |
sudo systemctl start nginx.service | |
# gcc and python-devel required for uwsgi |
View sudoku_checker.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, division | |
def check_sudoku(arr): | |
# 9 rows, 9 columns and 9 sub squares | |
# Each of them need to have all the digits | |
# Not using bit shifting | |
alignments = [987654321] * 27 | |
for i, row in enumerate(arr): | |
for j, x in enumerate(row): |
View iconutil_icns.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir MyIcon.iconset | |
sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png | |
sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_16x16@2x.png | |
sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png | |
sips -z 64 64 Icon1024.png --out MyIcon.iconset/icon_32x32@2x.png | |
sips -z 128 128 Icon1024.png --out MyIcon.iconset/icon_128x128.png | |
sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_128x128@2x.png | |
sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_256x256.png | |
sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_256x256@2x.png | |
sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_512x512.png |
NewerOlder