Skip to content

Instantly share code, notes, and snippets.

@arjunmenon
arjunmenon / animated_wallpaper.c
Created August 13, 2024 12:29 — forked from AlecsFerra/animated_wallpaper.c
POC for simple animated wallpapers in Xorg
#define _POSIX_C_SOURCE 199309L
//#define DEBUG
#include <Imlib2.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@arjunmenon
arjunmenon / basic_anim.c
Created August 13, 2024 12:29 — forked from CardealRusso/basic_anim.c
basic animated wallpapers in Xorg https://youtu.be/guchbe-gKis?t=257
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <X11/Xlib.h>
#include <Imlib2.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if (argc < 4 || argc > 5) {
fprintf(stderr, "Usage: %s <image_folder> <frame_delay> <screen_number> [loop]\n", argv[0]);
@arjunmenon
arjunmenon / Lightweight Speech to Text with PocketSphinx.ipynb
Created December 12, 2021 22:33 — forked from stevemclaugh/Lightweight Speech to Text with PocketSphinx.ipynb
Simple, fast, reasonably accurate speech-to-text processing for audio recordings of speech.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arjunmenon
arjunmenon / codepenclone.html
Created August 14, 2018 12:48 — forked from pachacamac/codepenclone.html
Mini Codepen Clone with sharing function
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>MiniCodepenClone</title>
<style>
body,textarea,iframe{ margin:0; box-sizing:border-box; }
textarea,iframe { width:100%; height:50vh; float:left; }
textarea { color:#eee; background:#111; font-family:monospace; font-size:11pt; line-height:1.4; width:33.33%; }
#shareBtn { position:absolute; bottom:0; left:0; }
@arjunmenon
arjunmenon / Readme.md
Last active June 12, 2018 15:19
Glade DSL

Run test_glade.rb
Run basic.rb

@arjunmenon
arjunmenon / create_xml.rb
Created June 12, 2018 12:01 — forked from kimjoar/create_xml.rb
Simple Ruby DSL to generate XML
require './xmldsl'
Twitter = Struct.new :name, :avatar, :text
twitters = []
5.times { twitters << Twitter.new("Jonas", "/profile.png", "Hello World!") }
xml = XML.generate do
html do
body do
twitters.each do |tw|
@arjunmenon
arjunmenon / Hash.from_xml
Created June 6, 2018 21:07 — forked from huy/Hash.from_xml
Convert xml to hash using Nokogiri
# USAGE: Hash.from_xml(YOUR_XML_STRING)require 'rubygems'
require 'nokogiri'
# modified from http://stackoverflow.com/questions/1230741/convert-a-nokogiri-document-to-a-ruby-hash/1231297#123129
7
class Hash
class << self
def from_xml(xml_io)
begin
result = Nokogiri::XML(xml_io)
@arjunmenon
arjunmenon / vin_to_gif.rb
Created April 10, 2018 19:54 — forked from seyhunak/vin_to_gif.rb
Vine MP4 to GIF Converting using Ruby
# space150 vine-to-GIF
# given a vine.co uri, downloads the MP4 and creates an image sequence / GIF from it
# requires ruby, ffmpeg, and imagemagick
require 'open-uri'
require 'nokogiri'
id = ARGV[0]
# try to convert from URL to id.
@arjunmenon
arjunmenon / python_server
Created January 1, 2018 13:20
Python server monitring any HTTP requests
#!/usr/bin/env python
# Read requests from HTTP methods GET, POST, PUT, DELETE, NOTIFY or any other custom method
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
var Client = require('./upnp_client.js')
var client = new Client('http://192.168.1.6:49152/description.xml');
console.log(client);
// Get the device description
client.getDeviceDescription(function(err, description) {
if(err) throw err;
console.log("starting device description module")
console.log(description);