Discover Gists

View Postgresql Database Backup & Restore
1 2 3 4 5 6 7 8 9 10
First take dump using this method
Dump schema of database:
 
pg_dump -Fp -s -v -f nfhs-schema.sql -U postgres dbname
 
Dump contents of database:
 
pg_dump -Fc -v -f nfhs-full.dump -U postgres dbname
 
Then restore using this methodology
View Application.java
1 2 3 4 5 6 7 8 9
package controllers;
 
import play.mvc.Controller;
import play.libs.Json;
 
import static controllers.Render.*;
import static play.mvc.Http.MimeTypes;
 
public class Application extends Controller {
View FloatLabelLayout.java
1 2 3 4 5 6 7 8 9 10
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View ExcelRemoveDup
1 2 3 4 5 6 7 8 9 10
Sub DelDups_TwoLists()
Dim iListCount As Integer
Dim iCtr As Integer
 
' Ark1 must contain the items which must be removed from Ark2
' Turn off screen updating to speed up macro.
Application.ScreenUpdating = False
 
' Get count of records to search through (list that will be deleted).
iListCount = Sheets("ark2").Cells(Rows.Count, "A").End(xlUp).Row
View 1. Not TCO.js
1 2 3 4 5 6 7 8 9 10
var sum = function(x, y) {
if (y > 0) {
// console.log('increase x ' + x + ' and decrease y ' + y + ' so we call sum(' + x + ', ' + (y - 1) + ') ');
return sum(x + 1, y - 1)
}
else {
// console.log('return x ' + x);
return x
}
}
View vim.textarea.js
1 2 3 4 5 6 7 8 9 10
// add our keyamp from github
var vimBinding = document.createElement('script');
vimBinding.setAttribute('src', 'https://rawgit.com/jakub-m/vim-in-textarea/master/jsvim.js');
// browser support for onload may be iffy ...
vimBinding.onload = function () {
var vim = new VIM();
 
Array.prototype.forEach.call(document.querySelectorAll('textarea'), function (instance){
View vim.jsbin.js
1 2 3 4 5 6 7 8 9 10
var vimBinding = document.createElement('script');
vimBinding.setAttribute('src','https://raw.github.com/marijnh/CodeMirror/master/keymap/vim.js');
 
var mirrors = document.querySelectorAll('.CodeMirror');
// browser support for onload may be iffy ...
vimBinding.onload = function () {
Array.prototype.forEach.call(mirrors, function (instance){
instance.CodeMirror.setOption('keyMap','vim');
});
View WordCount
1 2 3 4 5 6 7 8 9
$('#editor').keyup(function () {
typewatch(function () {
// executed only 500 ms after the last keyup event.
var words = $('#editor').html().toString().split(' ');
// get number of words
console.log(words.length);
 
}, 500);
});
View gist:11244675
1 2 3 4 5 6 7 8 9
import shapeless._
import ops.record.{ Selector, Updater }
import record.{ FieldType, field }
 
trait PathLens[T, P] {
type Elem
def get(t : T) : Elem
def set(t : T)(e : Elem) : T
}
View Cosmetic Dentistry
1
At Dental Associates Roslindale our dentists recommend porcelain veneers as an excellent option for people who are unhappy with the cosmetic appearance of their teeth. These ultra-thin, porcelain slips fit perfectly over teeth, making them look cosmetically perfect and completely beautiful. An off-white or crooked smile can cause serious confidence problems. Porcelain veneers are a fantastic alternative for patients wanting a beautiful smile without surgery, harsh chemicals or painful treatments. For porcelain veneers to be applied, the underlying teeth, bone and gums must be healthy. Patients with gum disease or tooth decay must be treated prior to the placement of porcelain veneers.
Something went wrong with that request. Please try again.