Skip to content

Instantly share code, notes, and snippets.

Avatar
🚴‍♂️
Focusing

Romans Malinovskis romaninsh

🚴‍♂️
Focusing
View GitHub Profile
View gist:5966033
select `profile`.`id`,`profile`.`element_type`,`profile`.`element_class`,`profile`.`name`,`profile`.`created_by`,(select `user`.`name` from `user` where `user`.`is_deleted` = 0 and `profile`.`created_by` = `user`.`id` ) `created`,`profile`.`descr`,`profile`.`is_show`,`profile`.`created_dts`,(select count(*) from `follower` where `follower`.`element_id` = `profile`.`id` ) `followers`,`profile`.`category_id`,(select `category`.`name` from `category` where `profile`.`category_id` = `category`.`id` ) `category`,`profile`.`picture_id`,(select concat("/elexu/prototype/", `_f`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_3` on `_f_3`.`original_file_id` = `filestore_file`.`id` where `profile`.`picture_id` = `filestore_file`.`id` ) `picture`,(select (select concat("/elexu/prototype/", `_f`.`dirname`, "/", `filestore_file`.`filename`) `url` from `filestore_file` left
View gist:6132565
<?php
// Add a player and link player's API with a button-click in PHP
$p=$this->add('View_VimeoPlayer');
$this->add('Button')->js('click', $p->vimeo()->api('play'));
class View_VimeoPlayer extends View {
function init(){
parent::init();
View gist:6995173
Fat-Crow-4:mongodb-src-r2.4.6 rw$ export CXXFLAGS="-ntosehusnatoehusantoehusnatohu"
Fat-Crow-4:mongodb-src-r2.4.6 rw$ python /usr/local/bin/scons install --prefix=/usr/local/Cellar/mongodb/2.4.6 -j8 --6
scons: Reading SConscript files ...
scons version: 2.3.0
python version: 2 7 5 'final' 0
Checking whether the C++ compiler works(cached) yes
Checking for C header file unistd.h... (cached) yes
Checking whether clock_gettime is declared... (cached) no
Checking for C++ header file execinfo.h... (cached) yes
Checking whether backtrace is declared... (cached) yes
@romaninsh
romaninsh / gist:6997201
Created Oct 15, 2013
mongodb fails link after building it with -stdlib=libstdc++
View gist:6997201
This file has been truncated, but you can view the full file.
g++ -o build/darwin/64/mongo/client/gridfs.o -c -Wnon-virtual-dtor -Woverloaded-virtual -stdlib=libstdc++ -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O3 -m64 -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -Ibuild/darwin/64/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/darwin/64/third_party/s2 -Isrc/third_party/s2 -Ibuild/darwin/64/third_party/boost -Isrc/third_party/boost -Ibuild/darwin/64/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/darwin/64 -Isrc -Ibuild/darwin/64/mongo -Isrc/mongo -I/usr/64/include -Ibuild/darwin/64/third_party/s2 -Isrc/third_party/s2 -Ibuild/darwin/64/third_party/snappy -Isrc/third_party/snappy -Ibuild/darwin/64/third_party/v8/include -Isrc/third_party/v8/include src/mongo/client/gridfs.cpp
View gist:7006395
This file has been truncated, but you can view the full file.
Fat-Crow-4:Formula rw$ brew install -v -v -v mongodb
Warning: Your Xcode (5.0) is outdated
Please install Xcode 5.0.1.
==> Downloading http://downloads.mongodb.org/src/mongodb-src-r2.4.6.tar.gz
Already downloaded: /Library/Caches/Homebrew/mongodb-2.4.6.tar.gz
tar xf /Library/Caches/Homebrew/mongodb-2.4.6.tar.gz
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.9.5 (Ruby 1.8.7-358; Mac OS X 10.9) https://github.com/mongodb/mongo/commit/be4bc7.patch -o 000-homebrew.diff https://github.com/romaninsh/mongo/commit/11db5d2.patch -o 001-homebrew.diff https://github.com/romaninsh/mongo/commit/1425af7.patch -o 002-homebrew.diff
######################################################################## 100.0%
@romaninsh
romaninsh / gist:7217119
Created Oct 29, 2013
Implementation of Agile Slides: http://agiletech.ie/
View gist:7217119
<?php
class AgileSlides extends View {
/*
This class implements multiple slides and ajax buttons for next/prev
*/
public $step,$data;
function init(){
parent::init();
$this->step=$_GET[$this->name];
View gist:8540085
select SQL_CALC_FOUND_ROWS
`al_mo`.`id`,`al_mo`.`name`,`al_mo`.`created_dts`,`al_mo`.`deleted`,`al_mo`.`description`,
`al_mo`.`category_id`,
(select `al_ca`.`name` from `category` `al_ca` where `al_ca`.`deleted` = "N" and `al_mo`.`category_id` = `al_ca`.`id` ) `category`,
`al_mo`.`votes_support`,`al_mo`.`votes_abstain`,`al_mo`.`votes_oppose`, `al_mo`.`votes`,`al_mo`.`comments`,`al_mo`.`arguments`,
`al_mo`.`flags`,`al_mo`.`user_id`,
(select `al_us`.`name` from `user` `al_us` where `al_us`.`deleted` = "N" and `al_mo`.`user_id` = `al_us`.`id` ) `user_name`,
`al_mo`.`last_comment_dts`, `al_mo`.`last_vote_dts`,`al_mo`.`last_flag_dts`,`al_mo`.`last_argument_dts`,`al_mo`.`url`,
al_mo`.`is_hc`,`al_mo`.`motion_category_id`,`al_mo`.`video_id`,`al_mo`.`video_link`,`al_mo`.`tags`,
`al_mo`.`image_id`,
View gist:10281987
select `article`.`id`,`article`.`image_id`,(select concat('/', `_f`.`dirname`, '/', `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_3` on `_f_3`.`original_file_id` = `filestore_file`.`id` where `article`.`image_id` = `filestore_file`.`id` ) `image`,(select concat('/', `_f`.`dirname`, '/', `filestore_file`.`filename`) `url` from `filestore_file` left join `filestore_volume` as `_f` on `_f`.`id` = `filestore_file`.`filestore_volume_id` inner join `filestore_image` as `_f_3` on `_f_3`.`original_file_id` = `filestore_file`.`id` where `article`.`image_id` = `filestore_file`.`id` ) `image_4`,`article`.`show_photo_in_article`,`article`.`title`,`article`.`description`,`article`.`text`,`article`.`url_hash`,`article`.`date`,`article`.`time`,`article`.`meta_keywords`,`article`.`meta_description`,`article`.`news_of_the_day`,`article`.`is_published`,`article`.`is_archived`,`artic
View input
I SAW THE MAN WITH THE BINOCULARS
THEY ARE HUNTING DOGS
FREE WHALES
POLICE HELP DOG BITE VICTIM
HE SAW THAT GAS CAN EXPLODE
TURN RIGHT HERE
WE SAW HER DUCK
IN ANIMAL CRACKERS GROUCHO MARX AS CAPTAIN RUFUS T SPAULDING QUIPPED ONE MORNING I SHOT AN ELEPHANT IN MY PAJAMAS HOW HE GOT IN MY PAJAMAS I DONT KNOW
SHIP SAILS TOMORROW
BOOK STAYS IN LONDON
You can’t perform that action at this time.