Skip to content

Instantly share code, notes, and snippets.

View kalyan02's full-sized avatar

kalyan02

View GitHub Profile
@kalyan02
kalyan02 / cal-alert.py
Created May 16, 2023 19:16
Python script to show alert when a meeting is starting in 1 min
import subprocess
import datetime
import time
minutes=2
calendar_name = "Home"
def run_applescript(script):
osa_command = ['osascript', '-e', script]
return subprocess.run(osa_command, capture_output=True, text=True).stdout
@kalyan02
kalyan02 / repetition_algorithm.ipynb
Created March 5, 2020 20:49 — forked from doctorpangloss/repetition_algorithm.ipynb
Supermemo 2 Algorithm, Unobscured (Python 3)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var cultureMap = [
{
"id": 1,
"name": "Argentina",
"datamapId": "ARG",
"isoCode": 32,
"isoShortCode": "AR",
"scores": {
"communicating": 56,
"evaluating": 56,
[
{
"id": 1,
"name": "Argentina",
"datamapId": "ARG",
"isoCode": 32,
"isoShortCode": "AR",
"scores": {
"communicating": 56,
"evaluating": 56,
@kalyan02
kalyan02 / 4015.ino
Last active December 7, 2015 12:33
4015IC Arduino Test
const int R_DATA = 1;
const int R_RESET = 2;
const int R_CLOCK = 3;
void setup() {
pinMode(R_DATA, OUTPUT);
pinMode(R_RESET, OUTPUT);
pinMode(R_CLOCK, OUTPUT);
int b[] = {0,0,0,0,1,0,1,1};
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
tell application "Google Chrome Canary" to return title of active tab of front window
# Chromium
@kalyan02
kalyan02 / ios_icons_resize.sh
Created November 1, 2013 14:21
Script to resize iOS icons Usage: $ ./ios_icons_resize.sh base_icon.png
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon-57.png"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon-57@2x.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png"
@kalyan02
kalyan02 / wp-archives-template.php
Last active December 19, 2015 13:49
Custom archives template for wordpress that lists all the posts grouped under month/year. I use it on this page - http://blog.fuss.in/archives/
<?php
/**
* Template Name: Archives list page
*
* Custom archives template for wordpress that lists all the posts grouped under month/year. I use this on http://blog.fuss.in/archives/
*
* To use:
* 1. Paste this file into wp-content/themes/<theme-name>/page-templates/
* 2. Select page template as "Archives List Page" on the right side bar in "New Page", page.
* 3. insert this short tag "[archives]", wherever you want the list to be displayed.
@kalyan02
kalyan02 / resize.py
Created July 6, 2013 18:42
A utility to resize files. Usage: $ python resize.py *.jpg -o resized/ -s 1280
#!/usr/bin/python
import Image
import os
import sys
import glob
from optparse import OptionParser
args = sys.argv
parser = OptionParser()
parser.add_option("-o", "--output", dest="output")
@kalyan02
kalyan02 / lightroom_select.sql
Created December 14, 2012 09:11
Query to select all the images, their metadata, tags, attributes, info about virtual copy, parent copy, etc from your "Lightroom" sqlite file ( .lrcat catalog file )
SELECT
rf.absolutePath,
fo.pathFromRoot,
fi.baseName || '.' || fi.extension as fullName,
ai.*,
ds.*,
fi.*,
rf.*
FROM
Adobe_images ai