Skip to content

Instantly share code, notes, and snippets.

Avatar

Cyrus Ghazanfar cyzanfar

View GitHub Profile
@cyzanfar
cyzanfar / bitly_csv
Created Jun 19, 2017
generate csv file from bitly data
View bitly_csv
# code here
View getting started
# 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 Jan 20, 2017
Least Recently Used Algorithm in Ruby
View gist.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
View youtube-video-list
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\-\=]+)?)$/
View gist:807e5a9b85848107d422
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++) {
View gist:f1663db79302c1c54a4b
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++) {