Skip to content

Instantly share code, notes, and snippets.

View cyzanfar's full-sized avatar

Cyrus Ghazanfar cyzanfar

View GitHub Profile
@cyzanfar
cyzanfar / bitly_csv
Created June 19, 2017 14:21
generate csv file from bitly data
# code here
# Our the apps:
# For the Joinery app you'll need to navigate to the repository's master branch and fork it so that you have your own version
# of the code. Then copy the SSH link from your own fork and clone the repository on your local machine.
`git clone git@github.com:[YOUR_GITHUB_USERNAME]/nestie.git`
# please follow the instructions in the README.md to get the application set up on your machine. You'll need Rails installed before doing anything http://installrails.com/
# For the Python application:
@cyzanfar
cyzanfar / gist.ruby
Last active January 20, 2017 20:58
Least Recently Used Algorithm in Ruby
Node = Struct.new(:value, :prev_node, :next_node)
class LRU
attr_accessor :head, :tail, :num_items, :max_items
def initialize(max_items)
@max_items = max_items
@head, @tail = nil
@table = {}
@num_items = 0
require 'google/api_client'
module Youtube
class VideoList
YOUTUBE_API_SERVICE_NAME = 'youtube'
YOUTUBE_API_VERSION = 'v3'
YOUTUBE_ID_REGEX = /^(https?:\/\/(?:youtu.be\/|www.youtube.com\/(?:watch\?v=|embed\/))(?<youtube_id>[\w\-]{4,16})\??([\w\-\=]+)?)$/
var $ = function (selector) {
var elements = [];
var classPosition = selector.split('').indexOf(".");
var idPosition = selector.split('').indexOf("#");
var selectorArray = selector.split("");
if ( classPosition === -1 && idPosition === -1){
var elementCollections = document.getElementsByTagName(selector);
for (var i = 0; i < elementCollections.length; i++) {
var $ = function (selector) {
var elements = [];
var classPosition = selector.split('').indexOf(".");
var idPosition = selector.split('').indexOf("#");
var selectorArray = selector.split("");
if ( classPosition === -1 && idPosition === -1){
var elementCollections = document.getElementsByTagName(selector);
for (var i = 0; i < elementCollections.length; i++) {