Skip to content

Instantly share code, notes, and snippets.

View giosakti's full-sized avatar
✍️
Writing code

Giovanni Sakti giosakti

✍️
Writing code
View GitHub Profile

The Why & Core Concept

Must Read

  • The Phoenix Project
  • The DevOps Handbook

Nice To Read

  • Release It!: Design and Deploy Production-Ready Software
Java::JavaLang::IllegalArgumentException (the salt parameter must not be empty):
javax.crypto.spec.PBEKeySpec.<init>(PBEKeySpec.java:118)
org.jruby.ext.openssl.PKCS5.generatePBEKey(PKCS5.java:112)
org.jruby.ext.openssl.PKCS5.pbkdf2_hmac_sha1(PKCS5.java:62)
org.jruby.ext.openssl.PKCS5$INVOKER$s$1$0$pbkdf2_hmac_sha1.call(PKCS5$INVOKER$s$1$0$pbkdf2_hmac_sha1.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:296)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:72)
org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
@giosakti
giosakti / Application.java
Last active March 15, 2019 01:38
gradle-jersey-jetty-sample
package com.starqle.hcm;
import com.sun.jersey.spi.container.servlet.ServletContainer;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
public class Application {
public static void main (String[] args) throws Exception {
ServletHolder sh = new ServletHolder(ServletContainer.class);
app.factory "User", ($resource, apiPrefix, AuthTokenHandler) ->
resource = $resource( apiPrefix + "/users/:id",
id: "@id"
,
update:
method: "PUT"
)
resource = AuthTokenHandler.wrapActions(resource, [
"query", "get", "save", "update", "delete"]
@giosakti
giosakti / auth-token-handler.js.coffee
Created May 8, 2013 02:58
auth-token-handler.js.coffee
app.factory "AuthTokenHandler", () ->
authTokenHandler = {}
authToken = "none"
# Getter / setter
authTokenHandler.get = () ->
return authToken
authTokenHandler.set = (newAuthToken) ->
authToken = newAuthToken
app.run ($rootScope, Session, AuthTokenHandler, $location) ->
# Watch Session signedIn variable and reasign rootScope session variables
# accordingly.
$rootScope.$watch (->
Session.signedIn
), () ->
$rootScope.currentUser = Session.currentUser
$rootScope.signedIn = Session.signedIn
$rootScope.signedOut = Session.signedOut
app.service "Session", (sessionStore, UserSession) ->
# Initialize variables (happens every page load)
@signedIn = !!window.sessionStorage.getItem(sessionStore)
@signedOut = not @signedIn
if @signedIn
@currentUser = JSON.parse(window.sessionStorage.getItem(sessionStore)).user
@userSession = new UserSession(
login: ""
@giosakti
giosakti / file_managers.js.coffee
Created January 15, 2013 01:52
Adding Custom Context Menu for elFinder
# ======================================================================
# admin/file_managers.js.coffee
#
# Description:
# contains snippets & functions for handling file-manager-related operation.
# ======================================================================
root = exports ? this
$ ->
@giosakti
giosakti / application.rb
Created September 25, 2012 01:30 — forked from finack/application.rb
Example Chef Deploy Revision for Rails 3+
app = node[:rails][:app]
rails_base app[:name] do
ruby_ver app[:ruby_ver]
gemset app[:gemset]
end
%w{config log pids cached-copy bundle system}.each do |dir|
directory "#{app[:app_root]}/shared/#{dir}" do
owner app[:deploy_user]
@giosakti
giosakti / deploy.rb
Created July 3, 2012 09:55
[DELETED] anotasi deploy.rb
require 'bundler/capistrano'
# use rvm
set :rvm_ruby_string, 'ruby-1.9.3-p194@unm'
# set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")
set :rvm_type, :system
require 'rvm/capistrano'
load "config/recipes/base"
load "config/recipes/mysql"