Skip to content

Instantly share code, notes, and snippets.

palaniraja palaniraja

Block or report user

Report or block palaniraja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@palaniraja
palaniraja / out.html
Last active Mar 12, 2019
Find all the files changed between two commits and cumulated commit messages per file
View out.html
<html><head><style>td{white-space: pre;}</style></head><body><table border=1>
<tr>
<td>File: (file1.txt)</td>
<td>
5755793 commit from master (correct this time)
322afb2 file 1 modified, and to be tagged as v1
</td></tr>
<tr>
<td>File: (file2.txt)</td>
@palaniraja
palaniraja / alias.sh
Created Nov 12, 2018
alias - alias from my work machine to refer later (ohmyzsh + few custom)
View alias.sh
-='cd -'
...=../..
....=../../..
.....=../../../..
......=../../../../..
1='cd -'
2='cd -2'
3='cd -3'
4='cd -4'
5='cd -5'
@palaniraja
palaniraja / app.js
Last active Nov 1, 2018
React native - webview wrapper - keyboard issue
View app.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Component} from 'react';
import {StyleSheet, WebView, View, Text, SafeAreaView, KeyboardAvoidingView} from 'react-native';
@palaniraja
palaniraja / main.dart
Last active Oct 15, 2018
Flutter - Asynchronous programming snippet
View main.dart
import 'dart:convert';
import 'dart:async';
import 'dart:html';
void main(){
_getIPAddress() {
final url = 'https://httpbin.org/ip';
Future<HttpRequest> request = HttpRequest.request(url);
request.then((value) {
print(json.decode(value.responseText)['origin']);
@palaniraja
palaniraja / Default.idekeybindings
Last active Aug 20, 2018
xcode - behaviour keybindings from `~/Library/Developer/Xcode/UserData/KeyBindings`
View Default.idekeybindings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Menu Key Bindings</key>
<dict>
<key>Key Bindings</key>
<array>
<dict>
<key>Action</key>
@palaniraja
palaniraja / twitter.md
Created Aug 17, 2018
Twitter data size analysis
View twitter.md

twitter.txt is output of df -ah twitter exported data. Removed each ./tweet_media file sizes)

Stats on my account

  45 - Followers
 287 - Following
   2 - Listed
9930 - Tweets  
7527 - Favorites
@palaniraja
palaniraja / pilapse.py
Created Jul 26, 2018
PiLapse - Python script to take timelapse
View pilapse.py
#!/usr/bin/python
import os
import time
import subprocess
from time import sleep
import random
# Configuration
@palaniraja
palaniraja / auto-shutdown.sh
Last active Jun 22, 2018
auto-shutdown on higher temprature for raspberrypi - kill kodi & fbi along - copied from raspberrypi forum
View auto-shutdown.sh
#!/bin/sh
# This script reads the Broadcom SoC temperature value and shuts down if it
# exceeds a particular value.
# 80ºC is the maximum allowed for a Raspberry Pi.
# Get the reading from the sensor and strip the non-number parts
SENSOR="`/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f2 | cut -d "'" -f1`"
# -gt only deals with whole numbers, so round it.
TEMP="`/usr/bin/printf "%.0f\n" ${SENSOR}`"
# How hot will we allow the SoC to get?
@palaniraja
palaniraja / merge-mp4.sh
Last active May 15, 2019
Bash script to merge all mp4 videos in current directory (recursively 2 levels). It also updates the chapter marks to retain the folder/filename of source dir
View merge-mp4.sh
#!/bin/bash
## Script to merge all mp4 videos in current directory (recursively 2 levels)
## And update chapter marks to retain the folder/filename
## Script for merging videos
filename=`basename pwd`
current=`pwd`
@palaniraja
palaniraja / camera-lens.xml
Created Jun 14, 2018
My Canon SLR lens - optics info from lensfun
View camera-lens.xml
<xml>
<lens>
<maker>Canon</maker>
<model>Canon EF-S 18-55mm f/3.5-5.6 IS II</model>
<mount>Canon EF-S</mount>
<!-- Average crop factor of Canon APS-C cameras -->
<cropfactor>1.611</cropfactor>
<calibration>
<distortion model="ptlens" focal="18" a="0.02504" b="-0.06883" c="0.01502"/>
<distortion model="ptlens" focal="24" a="0.0203" b="-0.06514" c="0.04768"/>
You can’t perform that action at this time.