This file contains 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
for i in $(seq 40000); do mysql -e "create database test_$i"; for j in $(seq 250); do mysql test_$i -e "create table test_$j (id int not null auto_increment primary key) engine=innodb; insert into test_$j values (null),(null),(null);"; done; done |
This file contains 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
# Requires : employees dataset (https://dev.mysql.com/doc/employee/en/) | |
# Then just create table employees_idx_on_hire_date like employees; alter table employees_idx_on_hire_date add key (hire_date); | |
# Pick one of these: | |
cat<<EOF>query.txt | |
select * from employees.employees_idx_on_hire_date order by hire_date desc limit 10 | |
EOF | |
cat<<EOF>query.txt |
This file contains 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
;; show matching parenthesis | |
(show-paren-mode 1) | |
;; evil mode always on so I can keep using the vim shortcuts I know | |
(evil-mode 1) | |
(add-to-list 'load-path "/Users/fernandoipar/.emacs.d/") | |
;; logito, pcache, tabulated list, gh-ghist, required by gist | |
(require 'logito) | |
(require 'pcache) |
This file contains 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
;; show matching parenthesis | |
(show-paren-mode 1) | |
;; evil mode always on so I can keep using the vim shortcuts I know | |
(require 'evil) | |
(evil-mode 1) | |
(add-to-list 'load-path "/Users/fernandoipar/.emacs.d/") | |
;; logito, pcache, tabulated list, gh-ghist, required by gist | |
(require 'logito) |
This file contains 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
-- build binary with: | |
-- ghc --make -o hello maintest.hs | |
module Main where | |
main = putStrLn "Hello, world" |
This file contains 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
require "java" | |
class Class | |
def atom_attr_accessor(*args) | |
self.class_eval(" | |
require 'clojure.jar' | |
java_import 'clojure.lang.LockingTransaction' | |
java_import 'clojure.lang.Atom' | |
") |
This file contains 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
cnt=-1 | |
f = nil | |
File.open(ARGV[0]).each_line do |line| | |
if line.match "^TS" | |
f.close unless f.nil? | |
f = File.open(line.gsub(" ","_"), 'w') | |
else | |
f.write(line.gsub(" Info: ","")) if line.match " Info: " and not line.match " Info: NULL" | |
end | |
end |
This file contains 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
EXPLAIN SELECT a.title, a.description AS text, '' AS created, '2' AS browsernav, a.id AS catid, CASE WHEN CHAR_LENGTH(a.alias) != 0 THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug FROM j_categories AS a WHERE (a.title LIKE '%super%' OR a.description LIKE '%super%') AND a.published IN (1,2) AND a.extension = 'com_content'AND a.access IN (1,1,2,3,6) GROUP BY a.id, a.title, a.description, a.alias ORDER BY a.title DESC LIMIT 0, 50; | |
EXPLAIN SELECT a.name AS title, '' AS created, a.con_position, a.misc, CASE WHEN CHAR_LENGTH(a.alias) != 0 THEN CONCAT_WS(':', a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(c.alias) != 0 THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as catslug, CONCAT_WS(',', a.name, a.con_position, a.misc) AS text,CONCAT_WS(' / ', 'Contacts', c.title) AS section,'2' AS browsernav FROM j_contact_details AS a INNER JOIN j_categories AS c ON c.id = a.catid WHERE (a.name LIKE '%super%' OR a.misc LIKE '%super%' OR a.con_position LIKE '%super%' OR a.address LIKE '%super%' OR a.s |
This file contains 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
#!/bin/bash | |
THREADS=3 | |
worker() | |
{ | |
echo "thread $1 starting" | |
sleep 3 | |
rm -f /tmp/lock.$1 | |
echo "thread $1 finished" |
This file contains 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 database = "sample"; | |
var collection = "tests"; | |
var connections = []; | |
config = db.getMongo().getDB("config"); | |
config.shards.find().forEach( | |
function (shard,_a,_i) { | |
connections.push(new Mongo(shard["host"])); | |
} |