Skip to content

Instantly share code, notes, and snippets.

View stefanneculai's full-sized avatar
🎯
Focusing

Stefan Neculai stefanneculai

🎯
Focusing
View GitHub Profile
@stefanneculai
stefanneculai / gist:5890109
Last active December 19, 2015 03:29
Generate Disqus SSO payload using Ruby
require 'rubygems'
require 'base64'
require 'cgi'
require 'openssl'
require "json"
DISQUS_SECRET_KEY = '<YOUR_SECRET_KEY>'
DISQUS_PUBLIC_KEY = '<YOUR_PUBLIC_KEY>'
def get disqus_sso(user)
#!/bin/bash
# This script does the following:
# 1/ capture and download the latest backup
# 2/ load it to your local database
# Just replace any uppercase string with your own data
#
# CAPTURE
@stefanneculai
stefanneculai / image_upload.js
Created February 5, 2014 22:55
Image upload using Froala WYSIWYG editor
$(function() {
$('.selector').editable({
// Set the image upload parameter.
imageUploadParam: 'file_param',
// Set the image upload URL.
imageUploadURL: '/upload_path',
// CORS. Only if needed.
crossDomain: false,
/*!
* froala_editor v1.1.7 (http://editor.froala.com)
* Copyright 2014-2014 Froala
*/
/**
* French
*/
$.Editable.LANGS['he'] = {
/*!
* froala_editor v1.2.3 (http://editor.froala.com)
* Copyright 2014-2014 Froala
*/
/**
* Croatian.
*/
$.Editable.LANGS['hr'] = {
@stefanneculai
stefanneculai / AWS_CONFIG.rb
Last active June 26, 2019 05:29
Amazon Signature Ruby
AWS_CONFIG = {
'access_key_id' => YOUR_ACCESS_KEY,
'secret_access_key' => YOUR_SECRET_ACCESS_KEY,
'bucket' => 'froala',
'acl' => 'public-read',
'key_start' => 'uploads/',
'region' => 's3' # For other regions than us-east-1, use s3-region. E.g.: s3-eu-west-1
}
@stefanneculai
stefanneculai / FileUpload.java
Created April 27, 2017 08:26 — forked from florinpopescu/FileUpload.java
Froala WYSIWYG Editor - Java integration example
package com.froala.examples.servlets;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
@stefanneculai
stefanneculai / index.html
Created November 9, 2018 13:08
Froala Editor with Webpack 4
<!doctype html>
<html>
<head>
<title>Froala with Webpack</title>
</head>
<body>
<div id="editor"></div>