This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('admin.stats', []) | |
.config(function($stateProvider) { | |
$stateProvider | |
.state('admin-stats', { | |
url: '/admin/stats', | |
templateUrl: 'admin/admin.stats/admin.stats.tpl.html', | |
controller: 'AdminStatController' | |
}); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Slf4j | |
@ControllerAdvice | |
public class ControllerConfig { | |
@ExceptionHandler(Exception.class) | |
public ModelAndView handleException(Exception ex, HttpServletResponse response) { | |
log.warn("Unchaught Exception", ex); | |
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); | |
// TODO handle AJAX calls differently |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: TestPlugin | |
*/ | |
function test_plugin_menu(){ | |
add_options_page('TestPlugin Settings', 'TestPlugin', 'manage_options', 'test-plugin-menu', 'test_plugin_options'); | |
} | |
add_action('admin_menu','test_plugin_menu'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_old=oldDB | |
_new=newDB | |
_user=user1234 | |
_pass=pass1234 | |
_oldDomain=staging.site.com | |
_newDomain=new.site.com | |
_db=db.site.com | |
mysqldump --databases "$_old" --user="$_user" --password="$_pass" --host "$_db" --add-drop-database > "$_file" | |
sed -e "s/$_old/$_new/g" "$_file" > "$_newFile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" class=""> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="shortcut icon" href="http://getbootstrap.com/docs-assets/ico/favicon.png"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<!-- project settings --> | |
<properties> | |
<tomcat.version>7.0.42</tomcat.version> | |
</properties> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Safe Search and Replace on Database with Serialized Data v2.0.1 | |
* | |
* This script is to solve the problem of doing database search and replace when | |
* developers have only gone and used the non-relational concept of serializing | |
* PHP arrays into single database columns. It will search for all matching | |
* data on the database and change it, even if it's within a serialized PHP | |
* array. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Be sure to use the latest selenium version | |
as there might be some problems with JSON serialization | |
Before running the test make sure you started appium server | |
with TestApp app: grunt appium:TestApp | |
""" | |
import unittest | |
import os | |
import sys | |
from random import randint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install rbenv ruby-build | |
echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile | |
source ~/.bash_profile | |
rbenv install 2.0.0-p0 | |
rbenv local 2.0.0-p0 | |
gem install cocoapods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.io.FileUtils; | |
import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags; | |
import org.bouncycastle.openpgp.*; | |
import org.bouncycastle.openpgp.examples.ByteArrayHandler; | |
import org.bouncycastle.openssl.PEMReader; | |
import org.bouncycastle.util.io.Streams; | |
import java.io.*; | |
import java.security.NoSuchProviderException; | |
import java.security.Security; |