Skip to content

Instantly share code, notes, and snippets.

@venriq
venriq / installing-node-with-nvm.md
Created April 28, 2018 17:38 — forked from d2s/installing-node-with-nvm.md
Installing Node.js for Linux & macOS with nvm
@venriq
venriq / long_running_tasks.js
Last active August 29, 2015 14:27
Lists long running operations in MongoDB and terminate the offending one
PRIMARY> db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)
//or a simpler version
PRIMARY> db.currentOp({"active": true, "secs_running": {$gt: 5}})
//==============================================
class Fixnum
def prime?
('1' * self) !~ /^1?$|^(11+?)\1+$/
end
end
@venriq
venriq / gist:013653f59451865d0822
Last active August 29, 2015 14:15
Sublime configuration
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Solarized (dark) (SL).tmTheme",
"fade_fold_buttons": false,
"font_face": "Source Code Pro for Powerline",
"font_size": 12,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
<%= link_to my_path, method: :delete, confirm: 'Delete?', class: 'link-delete', 'data-message' => 'Are you sure?', 'data-severity' => 'danger', :remote => true do %>
<i class="icon-trash"></i>
<% end %>
$('.link-delete).bind('ajax:beforeSend', function() {
$('#mySpinner').show();
});
$('.link-delete).bind('ajax:complete', function() {
$('#mySpinner').hide();
@venriq
venriq / Neo4j and Cypher
Last active December 17, 2015 16:19
Cypher queries
START a=node(*)
MATCH (a)-[r:ACTED_IN]->(m)<-[:DIRECTED]-(d)
RETURN a.name AS actor, r.roles AS role, m.title AS movie, d.name AS director;
Paths
==================
START a=node(*)
MATCH path=(a)-[r:ACTED_IN]->(m)<-[:DIRECTED]-(d)
RETURN path; || RETURN head(path); || RETURN nodes(path)