Skip to content

Instantly share code, notes, and snippets.

View fareesh's full-sized avatar

Fareesh Vijayarangam fareesh

View GitHub Profile
@fareesh
fareesh / assistant.py
Created March 10, 2024 23:29
Poor Man's Siri
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A modified version of the "assistant" example from pywhispercpp
"""
import queue
import time
from typing import Callable
import numpy as np
@fareesh
fareesh / hugo-tweet-shortcode.html
Created March 6, 2024 22:08
Hugo Shortcode to render both light & dark mode of a tweet. CSS can be used to show/hide as required.
{{- define "render-tweet" -}}
<div class="tweet-container">
{{- $id := .id -}}
{{- $user := .user -}}
{{- $url := printf "https://twitter.com/%v/status/%v" $user $id -}}
{{/* Light Theme Tweet */}}
<div class="tweet tweet-light" data-theme="light">
{{- $queryLight := querify "url" $url "dnt" .dnt "theme" "light" -}}
{{- $requestLight := printf "https://publish.twitter.com/oembed?%s" $queryLight -}}

Keybase proof

I hereby claim:

  • I am fareesh on github.
  • I am fareesh (https://keybase.io/fareesh) on keybase.
  • I have a public key ASAPELgtGlUtGoCykqclgof6C5a_WopDW5KN_gkF8Qgxywo

To claim this, I am signing this object:

# replace.rb
#
# Usage: ruby replace.rb test.html
# Output: test.html with padding CSS replacements
filename = ARGV[0]
pairs = [["padding-top:9px;","padding-top:0px;"],["padding-top: 9px;","padding-top: 0px;"],["padding-bottom: 9px;","padding-bottom: 0px;"],["padding: 9px;","padding-top: 0px; padding-left: 9px; padding-right: 9px; padding-bottom: 0px;"],["padding-bottom:9px;","padding-bottom:0px;"],["padding:9px", "padding-top:0px;padding-bottom:0px;padding-left:9px;padding-right:9px;"]]
@fareesh
fareesh / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
module.exports = (grunt) ->
# configuration
grunt.initConfig
# grunt sass
sass:
compile:
options:
style: 'expanded'
@fareesh
fareesh / migrate_to_s3.rake
Created January 27, 2014 01:33
Use AWS-SDK to Migrate Paperclip Attachments from Files to S3
# Create config/s3.yml
# Example:
# development:
# bucket: electric-images
# access_key_id: AKIAJADQBJZ4GTP4FY7A
# secret_access_key: CKu9iYpFZoLRfr9zadtDRUA3BYUUWmnghyy2AJrg
# region: ap-southeast-1 #Change this
@fareesh
fareesh / gist:5006467
Last active September 12, 2020 16:50
The Tenets of Reasonablism

Reasonablism

The following outlines the tenets of Reasonablism.

Freedoms

Cognitive Liberty - Any individual's right to consider a fact, viewpoint or opinion, whether unique or that of others must be respected and encouraged.

Freedom of Speech and Communication - Any individual's freedom to communicate an idea, thought or message via any form of media or means of expression must be respected and encouraged. This excludes media that contains the likeness or non-commercial property of other individuals, or those that contradict other philosophies of reasonablism.

@fareesh
fareesh / README.markdown
Created March 21, 2012 10:27 — forked from isc/README.markdown
A micro gem providing an accordion view helper that generates the proper markup for Twitter Bootstrap

In your Gemfile:

gem 'bootstrap-components-helpers', :git => 'git://gist.github.com/2117187.git'

In your views:

= accordion do |accordion|

= accordion.pane 'My first pane' do