Skip to content

Instantly share code, notes, and snippets.

@dhoss
dhoss / DALSpec.scala
Created August 25, 2015 19:30
reducing with... stuff
"retrieve the correct page when specified" in new WithApplication
with RepositoryTable
with CommitTable
with ProjectTable
with WithDatabaseConfig
with DBCleanup
with DBFixtures {
import driver.api._
//create an instance of the table
val Projects = TableQuery[Projects]
getFlashVersion: function() {
// ie
try {
try {
var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
try { axo.AllowScriptAccess = 'always'; } catch(e) { return '6,0,0'; }
} catch(e) {}
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
} catch(e) {
try {
// Chessboard
var size = 8;
for (var i = 0; i < size; i++) {
var row = "";
for (var j = 0; j < size; j++) {
var total = i + j;
if (total % 2 == 0) {
row += '#';
} else {
@pakoito
pakoito / The Technical Interview Cheat Sheet.md
Last active August 25, 2015 19:32 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@davidmerrick
davidmerrick / gist:f81bbe5d6ab8d5de2963
Created August 25, 2015 19:32
Vim: disable line numbers
:set nonu
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 6. in line 1.
year;2013;2012;2011;2010;2009;2008;2007;2006;2005;2004;2003;2002;2001;2000
commercial housing average selling price (yuan/m2);6237;5790,99;5357,1;5032;4681;3800;3863,9;3366,79;3167,66;2778;2359;2250;2170;2112
commercial residential housing average selling price (yuan/m2);5850;5429,93;4993,17;4725;4459;3576;3645,18;3119,25;2936,96;2608;2197;2092;2017;1948
villa and upscale housing average selling price (yuan/m2);12591;11460,19;10993,92;10934;9662;7801;7471,25;6584,93;5833,95;5576;4145;4154;4348;4288
office average selling price (yuan/m2);12997;12306,41;12327,28;11406;10608;8378;8667,02;8052,78;6922,52;5744;4196;4336;4588;4751
housing for business use average selling price (yuan/m2);9777;9020,91;8488,21;7747;6871;5886;5773,83;5246,62;5021,75;3884;3675,14;3488,57;3273,53;3260,38
other commercial housing average selling price (yuan/m2);4907;4305,73;4182,11;4099;3671;3219;3351,44;3131,31;2829,35;2235;2240,74;1918,83;2033,08;1864,37
@crazyhottommy
crazyhottommy / compare_mutect_results.sh
Created August 25, 2015 19:33
compare mutect results overlapping
for i in {1..22} X Y
do
same=$(comm -12 <(cut -f1,2,4,5 keep_original_bam/TCGA-06-0125_$i.call.keep.txt | sort) <(cut -f1,2,4,5 keep_realigned_bam/TCGA-06-0125_$i.call.keep.txt| sort) | wc -l | tr -d " ")
original=`wc -l keep_original_bam/TCGA-06-0125_$i.call.keep.txt | awk '{print $1}'`
realigned=`wc -l keep_realigned_bam/TCGA-06-0125_$i.call.keep.txt | awk '{print $1}'`
printf "chromosome $i, original_bam:$original, realigned_bam:$realigned, common:$same \n"
done
@darwinrc
darwinrc / gist:a07c84b290a78b149090
Created August 25, 2015 19:33
Error gulp build
C:\Users\darwin\Source\Repos\naut\angularjs> gulp build
[13:56:04] Using gulpfile ~\Source\Repos\naut\angularjs\gulpfile.js
[13:56:04] Starting 'build'...
[13:56:04] Starting 'clean-scripts'...
[13:56:04] *** Cleaning: app/js/*{js,map}
[13:56:04] Starting 'clean-styles'...
[13:56:04] *** Cleaning: app/css/*{css,map}
[13:56:04] Starting 'clean-markup'...
[13:56:04] *** Cleaning: index.html,app/views/
[13:56:04] Finished 'clean-scripts' after 20 ms
@warlyware
warlyware / gulpfile.js
Created August 25, 2015 19:33
Main gulpfile
var gulp = require('gulp');
var args = require('yargs').argv;
var config = require('./gulpconfig')();
var del = require('del');
var g = require('gulp-load-plugins')({lazy: true});
gulp.task('vet', function() {
log('[1] checking source files for errors');
return gulp.src(config.dir.js)
@ellcorey
ellcorey / index.html
Created August 25, 2015 19:34
jPgepx
<div class="container">
<div class="left-col">
</div>
<div class="right-col">
</div>
</div>