Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View aredridel's full-sized avatar
💭
See my social media for status.

Aria Stewart aredridel

💭
See my social media for status.
View GitHub Profile
Friend.findOne({
userId: req.signedCookies.userid
}, function (err, signedInUser) {
function doCheck(err, currentUser) {
if (err) {
res.send(err);
} else {
console.log('doCheck');
//for(var x = 0; x < users.length; x++) {
//var currentUser = users[x];
module ApplicationHelper
def combine_highlight(selected_text, surrounding_text)
if surrounding_text.include? selected_text
split_text = surrounding_text.split(selected_text)
content_tag(:p, (split_text[0] || '').html_safe + content_tag(:span, selected_text, class:"selected") + (split_text[1] || '').html_safe)
else
content_tag(:p, surrounding_text, class:"selected")
end
end
module ApplicationHelper
def combine_highlight(selected_text, surrounding_text)
if surrounding_text.include? selected_text
split_text_array = surrounding_text.split(selected_text)
if split_text_array[0].blank?
if split_text_array[1].blank?
content_tag(:p, content_tag(:span, selected_text, class:"selected"))
else
/usr/img/lib/imgadm.js:1124
for (var j = 0; j < imageSet.length; j++) {
^
TypeError: Cannot read property 'length' of undefined
at done (/usr/img/lib/imgadm.js:1124:45)
at async.forEach (/usr/img/node_modules/async/lib/async.js:88:21)
at IMGADM.sourcesList.async.forEach.err (/usr/img/lib/imgadm.js:1102:21)
at IMGADM.clientFromSource (/usr/img/lib/imgadm.js:744:13)
at Source.getResolvedUrl (/usr/img/lib/imgadm.js:361:13)
at /usr/img/lib/imgadm.js:98:13
@aredridel
aredridel / demo.js
Last active December 16, 2015 18:58
Tiny backbone.js hints
var RowView = Backbone.View.extend({
initialize: function () {
this.model.on('change', this.handleChange, this);
},
handleChange: function () {
this.model.save();
},
render: function () {
this.setElement($('<tr>'));
this.$el.append("<td>" + this.model.get('id') + "</td><td>" + this.model.get('field1') + "</td>");
@aredridel
aredridel / gist:5427526
Created April 20, 2013 21:36
conversation on dependencies
17:17 judofyr: hey folks
17:17 judofyr: what's up?
17:17 Aria: Not too much.
17:17 Aria: Grumbling about managing ruby dependencies with RPM.
17:17 judofyr: RPM?
17:18 Aria: It's become so damn hard. So much versioning hell out there.
17:18 judofyr: why would you do that?
17:18 judofyr: bundler it up
17:18 Aria: I'm the OS integrator. We're trying to package apps out there for installation.
17:19 judofyr: hm
@aredridel
aredridel / logsubprocess.sh
Created November 15, 2012 05:41
Execute a logger as a subprocess and exec, leaving only the two child processes without using bash 4.0
#!/bin/bash
tmp=/tmp/$$.pipe
mkfifo $tmp
logger -p local6.debug < $tmp &
exec > $tmp
@aredridel
aredridel / vagrant.org
Created November 9, 2012 17:23 — forked from akiatoji/vagrant.org
CentOS 6.2 Box for Vagrant

Installing CentOS

Download net install iso:

  • CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
var repl = require('repl')
, rl;
rl = repl.start({
prompt: '>>> '
, input: process.stdin
, output: process.stdout
});
rl.on('close', function () {
@aredridel
aredridel / config.json
Created October 21, 2012 15:20
Example of configuration injection in node.js
{
"value": "config value here"
}