Skip to content

Instantly share code, notes, and snippets.

View CodingFu's full-sized avatar
🌴
Bali

Seva Rybakov CodingFu

🌴
Bali
View GitHub Profile
@CodingFu
CodingFu / deviseCheck.js
Created November 13, 2013 00:08
Simple devise user login check in node.js
var mysql = require('mysql')
, bcrypt = require('bcrypt')
, db = {
host: 'localhost',
user: 'root',
database: 'prod'
};
function checkUser(email, password, callback) {
var connection = mysql.createConnection(db);
@CodingFu
CodingFu / install_chef.sh
Last active August 29, 2015 14:07
Install chef development kit
#!/usr/bin/env sh
set -e
if [ -d /opt/chefdk ]; then
echo "ChefDK installed in /opt/chefdk, quitting" >&2
exit 0
fi
url="https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.2.2-1_amd64.deb"
pkg="/tmp/`basename \`echo $url\``"
@CodingFu
CodingFu / README.md
Created January 11, 2015 15:12
No name

README is empty

<!DOCTYPE html>
<html>
<% url = "https://www.terrorview.com/alerts/#{@alert.video ? :video : :article}?url=#{@alert.canonical}" %>
<head>
<meta property="og:title" content="<%= @alert.title %>" />
<meta property="og:url" content="<%= url %>" />
<meta property="og:image" content="<%= @alert.image %>" />
</head>
<body>
You are being redirected...
var request = require('request');
var pd = require('pretty-data').pd;
var xml2json = require('xml2json');
function buildSoapEnvelope(methodName, requestData, opts) {
return `
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<${methodName} xmlns="http://clients.mindbodyonline.com/api/0_5">
<Request>
sudo add-apt-repository -y ppa:webupd8team/java
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
echo "deb http://packages.elastic.co/kibana/4.4/debian stable main" | sudo tee -a /etc/apt/sources.list.d/kibana-4.4.x.list
echo 'deb http://packages.elastic.co/logstash/2.2/debian stable main' | sudo tee /etc/apt/sources.list.d/logstash-2.2.x.list
sudo apt-get update

About webhooks

all webhooks have type and timestamp in them

Subscribe webhook

{
  "type": "subscribe",
  "timestamp": "2017-04-24T12:43:59-04:00",
  
namespace :actblue do
task :import_csv => :environment do
list_id = ENV['LIST_ID']
list = List.find(list_id)
puts "Importing #{list.name}"
processed = 0
csv_path = ENV['CSV_PATH']
line_count = `wc -l "#{csv_path}"`.strip.split(' ')[0].to_i
// @flow
import { isFuture, subSeconds } from 'date-fns';
import { sortBy, uniq } from 'lodash';
import Sequelize from 'sequelize';
import sequelize from '../../../db/sequelize';
import { Input, Output } from '../../../api';
import { Course } from '../../../models';
const { Op } = Sequelize;
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Connecting to memcache url: "memcached-main.swi5ut.0001.usw2.cache.amazonaws.com:11211"
5715282698;0;0;;false
2144781439;0;0;;false
8175222733;7;7;;true
9096371391;7;7;neustar;true
6297720417;0;0;neustar;true
3462171537;0;0;neustar;true
4702952819;0;0;;false
8313259804;36;36;;true
7084766023;33;33;;true