Skip to content

Instantly share code, notes, and snippets.

View faustman's full-sized avatar
:dependabot:
I may be slow to respond.

Andrii Tytar faustman

:dependabot:
I may be slow to respond.
View GitHub Profile
@faustman
faustman / settings.js
Created August 10, 2013 16:38
provider settings
angular.module('displify.settings', [])
.provider('$settings', function() {
// Private variables
var account;
var client_settings_var = "_dsplfy";
// Private constructor
function Settings($log) {
this.account = account;
@faustman
faustman / hello.js
Created July 25, 2013 13:53
Function Call Stack GA Style
var Hello = function(argv){
if(argv instanceof Array){
while(f = argv.shift()) {
this.push(f);
}
}
return this;
}

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/opt/nginx/sbin/nginx
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@faustman
faustman / nginx.conf
Last active December 12, 2015 12:09
Pass subdomain to rewrite rule. Nginx
# Redirect http://test.domain.com to http://domain.com/?utm_source=test&utm_medium=423525
server {
listen 80;
server_name *.domain.com;
if ($host ~* ^([a-z0-9-\.]+)\.domain\.com$) { set $subdomain $1; }
rewrite ^ http://domain.com/?utm_source=$subdomain&utm_medium=$date_gmt permanent;
}
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Caveats
#
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails SQL Injection (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Caveats
#