Skip to content

Instantly share code, notes, and snippets.

View kalyan02's full-sized avatar

kalyan02

View GitHub Profile
@kalyan02
kalyan02 / tetris.html
Created November 9, 2011 20:07
jsTris
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tetris</title>
<style type="text/css">
body { text-align:center; font:12px "Helvetica Neue", Verdana; }
#container { text-align:center; border:0px solid #ccc; width:845px; margin:auto; overflow:hidden; margin-top:50px; }
#info { width:400px; text-align:left; float:left; border:0px solid #ccc; margin-left:20px; height:600px;
}
@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 / 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 / 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};
@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