Skip to content

Instantly share code, notes, and snippets.

@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
..\bin\openssl req -config cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %domain%\server.key -x509 -days 3650 -out %domain%\server.crt
echo.
echo -----
<?php
class MY_Security extends CI_Security{
//overriding the normal csrf_verify, this gets automatically called in the Input library's constructor
//verifying on POST and PUT and DELETE
public function csrf_verify(){
$request_method = strtoupper($_SERVER['REQUEST_METHOD']);
(function() {
var $injector = angular.injector(['ng']);
$injector.invoke(function($http, $rootScope) {
// this works!
$rootScope.$apply(function() {
$http.get("/auth/csrf_token").then(function(response) {
angular.module("app").constant("CSRF_TOKEN", response.csrf_token);
angular.bootstrap(document, ['app']);
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
@charlietfl
charlietfl / app.js
Created February 10, 2014 12:38
my app test
if(checkLogin()){
var app = angular.module('harvest', ['ui.bootstrap']);
app.run(function($http,HARVEST_API){
if( harvest.newData){
harvest.newData.method='new_token';
$http.post('ajax.php',harvest.newData);
@charlietfl
charlietfl / form-processor.php
Created February 3, 2013 17:27
Random numbers form
<?php
echo '<pre>';
print_r($_GET);
@charlietfl
charlietfl / cross-domain-object
Created January 15, 2013 10:43
object to test cross domain
var data={'foo':'bar'}
<option value="New York">New York</option>
<option value="Boston">Boston</option>
@charlietfl
charlietfl / gist:736354
Created December 10, 2010 15:42
jqPlot
/**
* Copyright (c) 2009 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT and GPL version 2.0 licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php .
*