Skip to content

Instantly share code, notes, and snippets.

View sprklinginfo's full-sized avatar

Lingling Jiang sprklinginfo

  • Sheridan College Library
  • Mississauga, ON, Canada
View GitHub Profile
#!/usr/bin/perl
=head1 NAME
viaflookup.pl - How to make use of VIAF authority records
=head1 VERSION
Version 0.2 - 2011-02-18
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@sprklinginfo
sprklinginfo / gist:2a241cadb93c3b8f3feb
Created October 19, 2015 20:09 — forked from mrconnerton/gist:1979037
node form in ctools modal drupal 7
<?php
/*
Make Sure you include:
ctools_include('modal');
ctools_modal_add_js();
On the pages you put your link.
*/
@sprklinginfo
sprklinginfo / what-forces-layout.md
Created January 28, 2016 14:27 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@sprklinginfo
sprklinginfo / Vagrant.bootstrap.sh
Created September 9, 2016 19:06 — forked from asmerkin/Vagrant.bootstrap.sh
A simple LAMP Vagrantfile and Bootstrap file for Vagrant and ubuntu/trusty64 box. It uses mpm-workers and php5-fpm + some extra tools like grunt, gulp and composer.
#!/usr/bin/env bash
# ---------------------------------------
# Virtual Machine Setup
# ---------------------------------------
# Adding multiverse sources.
cat > /etc/apt/sources.list.d/multiverse.list << EOF
deb http://archive.ubuntu.com/ubuntu trusty multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates multiverse
<!doctype html>
<html>
<head>
<title>ScholarWorks Badge Generator</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style>
body { font: 100% sans-serif; margin: 1em; }
h1 { margin: 0; }
h3, h4, label { display: block; margin: 1em 0 0 0; }
ol, p, pre { margin: 0 0 1em 0; }
@sprklinginfo
sprklinginfo / setup_selenium.sh
Created December 26, 2016 22:15 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@sprklinginfo
sprklinginfo / oaipmh-count.py
Created December 15, 2017 16:05 — forked from rlskoeser/oaipmh-count.py
Script to count records returned by an OAI-PMH provider
#!/usr/bin/env python
"""
A simple command line script to count the number of records returned by an OAI-PMH provider
OAI-PMH protocol documentation: https://www.openarchives.org/OAI/openarchivesprotocol.html
To install dependencies:
pip install lxml requests beautifulsoup4
@sprklinginfo
sprklinginfo / db_backup.sh
Created May 29, 2018 19:47 — forked from NARKOZ/db_backup.sh
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
@sprklinginfo
sprklinginfo / docker-help.md
Created May 7, 2019 16:34 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info