Skip to content

Instantly share code, notes, and snippets.

View djaney's full-sized avatar

Djane Rey Mabelin djaney

  • Arcanys, Inc.
  • Philippines
View GitHub Profile
#!/bin/bash
# intall
# curl https://gist.githubusercontent.com/djaney/0e16172a58b5415dfd28050b48a41829/raw/8f447171e880a2d82d031ef1ecacde4f52e343d3/djane.sh > ~/.local/bin/djane && chmod +x ~/.local/bin/djane
function install {
sudo apt-get update -y
sudo apt-get install -y v4l-utils
@djaney
djaney / clean.md
Last active April 22, 2020 03:01
Cleanup bloated git

get list of bloated files

git rev-list master | while read rev; do git ls-tree -lr $rev | cut -c54- | sed -r 's/^ +//g;'; done | sort -u | sort -rnk1 | head -n 20

Remove selected file from the historybooks!

replace DUMBFILE

git filter-branch --tag-name-filter cat --index-filter 'git rm -r --cached --ignore-unmatch DUMBFILE' --prune-empty -f -- --all
@djaney
djaney / DjaneHotas.3.0.binds
Last active August 22, 2020 15:22
Elite Dangerous bindings
<?xml version="1.0" encoding="UTF-8" ?>
<Root PresetName="DjaneHotas" MajorVersion="3" MinorVersion="0">
<KeyboardLayout>en-US</KeyboardLayout>
<MouseXMode Value="" />
<MouseXDecay Value="0" />
<MouseYMode Value="" />
<MouseYDecay Value="0" />
<MouseReset>
<Primary Device="{NoDevice}" Key="" />
<Secondary Device="{NoDevice}" Key="" />
@djaney
djaney / angle_to_hit_coords.py
Last active October 18, 2018 08:20
Angle to hit a coordinate with a projectile
#!/usr/bin/env python3
import math
import sys
def calculate_angle(velocity, x, y, gravity=9.8, high_angle=False):
angles = []
try:
rad = math.atan( ( velocity**2 + math.sqrt(velocity**4 - gravity * (gravity*x**2 + 2*y*velocity**2) ) ) / (gravity * x) )
angles.append(math.degrees(rad))
@djaney
djaney / timelapse.md
Created September 19, 2017 07:47 — forked from porjo/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

@djaney
djaney / .vimrc
Last active March 11, 2019 06:40
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
#!/usr/bin/python3
import random;
nodes = [3,3,4,4,4,1,1,1,1]
weights = []
def main():
for i in nodes:
for j in range(1, i+2):
@djaney
djaney / meta
Created May 20, 2017 08:36
Install codedeploy agent
#!/bin/bash
yum -y update
yum install -y ruby
yum install -y aws-cli
cd /home/ec2-user
aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1
chmod +x ./install
./install auto
<!DOCTYPE html>
<html>
<body>
<h1>Used for testing</h1>
<p>My first paragraph.</p>
</body>
</html>
Used for unit test