Skip to content

Instantly share code, notes, and snippets.

@sbiyyala
sbiyyala / README.md
Created April 1, 2019 01:49 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@sbiyyala
sbiyyala / extract_attendees.py
Last active February 3, 2018 00:19
Extract attendees for a meetup (new UI's csv download)
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import sys, numpy as np
import codecs
'''
numpy is a pre-req,
$ pip install numpy
$ ./extract_attendees.py > final_attendees.(txt|csv)
@sbiyyala
sbiyyala / attendeeList.js
Last active July 12, 2017 18:25
Scrape attendee list
$("tbody>tr").filter((a, e) => $(e).has("td>div>span.D_yes").size() > 0)
.map((a, e) => {
const mn = $(e).find(".D_name")
.text()
.replace("speaker","")
.replace("Organizer","")
.trim();
const qn = $(e).find("dd")
.contents()
.text()
@sbiyyala
sbiyyala / gist:3398eb0b85aea05588593aa773a4f3db
Created December 26, 2016 20:43 — forked from leejordan/gist:9f4ff825ad2631212fcc
Markdown/remark slides markdown
# Easily create slideshow presentations from markdown with remark.js
## Intro to remark.js
Remark.js is a web based slideshow with some great features that is comparable to powerpoint or google slides except you can write your presentations entirely in [markdown](http://daringfireball.net/projects/markdown/syntax).
You can see a [demo of remark.js in action here](http://remarkjs.com/) and when checking it out, be sure to press ```p``` to see the incredibly useful presenter mode.
## Useful features
@sbiyyala
sbiyyala / Currying.java
Created September 22, 2016 09:49 — forked from timyates/Currying.java
Currying and composition in Java 8
package java8tests ;
import java.util.function.BiFunction ;
import java.util.function.Function ;
public class Currying {
public void currying() {
// Create a function that adds 2 integers
BiFunction<Integer,Integer,Integer> adder = ( a, b ) -> a + b ;
const http = require('http');
const httpRequest = require('request');
const API_ENDPOINT = 'http://<hostname>:<port>/<path-to-resource>';
function normalizePort(val) {
const port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
;; See http://directed-procrastination.blogspot.com/2011/06/syncing-emacs-with-google-documents.html for more info
;; Okay, here is the plan. You need to run a browser in a different display (so
;; it does'nt mess up your focus). You need the following programs: Emacs,
;; xdotool, xsel, xpra, and of course X windows.
;; 1. Setup the mirroring by evaluating (setup-mirror).
;; 2. Start xpra:
@sbiyyala
sbiyyala / admin.py
Created January 30, 2014 21:45 — forked from uhop/admin.py
# Example how to add rich editor capabilities to your models in admin.
from django.contrib.admin import site, ModelAdmin
import models
# we define our resources to add to admin pages
class CommonMedia:
js = (
'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js',