Skip to content

Instantly share code, notes, and snippets.

View tinabme's full-sized avatar

Tina Barfield tinabme

  • GitHub Staff
  • USA
View GitHub Profile
@tinabme
tinabme / AngularJS_Pagination
Last active August 29, 2015 14:23
AngularJS Pagination
This is a simple example of how you can add pagination to an AngularJS view.
You can see it work here:
https://jsfiddle.net/tinabme/qdp6abg3/18/
docker --version
sudo su
echo deb https://apt.dockerproject.org/repo ubuntu-`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d'=' -f2` main >> /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D
apt-get update
@tinabme
tinabme / ignoreFile.md
Last active July 13, 2016 13:08
How to git ignore a single file that is already versioned

Ignore a single file that is already versioned

Sometimes you need to excluded a modified file from your git commit. There are a few ways to do this, my preference is this.

To ignore a single file that is already versioned:

git update-index --assume-unchanged "folder/folder/filename.foo"

Then you can complete your commit normally. sh (git commit -am "")

@tinabme
tinabme / param_for_js.MD
Created August 18, 2016 20:56
Param() for JavaScript -- no jQuery needed. Returns a serialized (url encoded) representation of an array or object for use in URL query string or Ajax request, without jQuery. Raw

Param() for JavaScript -- no jQuery needed

Returns a serialized (url encoded) representation of an array or object for use in URL query string or Ajax request, without jQuery.

Javascript Code

function param(obj) {
  let result = '';
  for (let key of Object.keys(obj)) {
    // if obj[key] is an object dig deeper
@tinabme
tinabme / find_the_anagrams.md
Created October 25, 2019 20:29
How to find the anagrams

How to find the anagrams

The Request

Given an array of words, write a method to output matching sets of anagrams. Words include "rates, rat, stare, taser, tears, art, tabs, tar, bats, state"

The Code

@tinabme
tinabme / alexa_top_sites.sh
Created April 6, 2022 18:00
Pulling Alexa top sites
#!/bin/bash
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin
# This is a quick bash script to grab the top 1 mil alexa urls and drop then in redis.
# Alexa limits the request to 50 per second and 100 per request. This can get expensive quickly so we only pull what you need.
# Set the initial startpoint var to 1 and increment by 100 with each group collected
# multiple sidekiq jobs can be set up pull many chunks at once
# To set/create the initial startpoint - before the first collection begins
# redis-cli SET startpoint 1