This file contains 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
# Lets install all the packages its needs | |
# Source: http://phalconphp.com/en/download | |
packages: | |
yum: | |
php55-devel.x86_64: [] | |
gcc.noarch: [] | |
libtool.x86_64: [] | |
git.x86_64: [] | |
commands: |
This file contains 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 | |
// Using array_key_exists avoids warnings when a key doesn't exist in the previous code. | |
// Warnings will cause 500 errors in error_reporting is set too high. | |
if (array_key_exists('CLIENT_IP', $_SERVER)) { | |
// if ($_SERVER['CLIENT_IP']) { | |
die($_SERVER['CLIENT_IP']); | |
} |
This file contains 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 "encoding/json" | |
func WriteJson(w http.ResponseWriter, results []interface{}) { | |
j, err := json.Marshal(results) | |
if err != nil { | |
panic(err.Error()) // proper error handling instead of panic in your app | |
} | |
w.Header().Add("Content-Type", "application/json") | |
fmt.Fprintf(w, string(j)) | |
} |
This file contains 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 | |
sudo rm -rf |
This file contains 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> | |
<head> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | |
<title>active-route Demo</title> | |
<script src="/components/platform/platform.js"></script> | |
<link rel="import" href="/internal/login-box.html"> | |
</head> |
This file contains 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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="simgrip-app"> |
This file contains 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
class QueryDict: | |
__dict = {} | |
def __init__(self, someDict): | |
self.__dict = someDict | |
# This is not dynamic but allows for specify a default | |
# example: myObject.get('someKey', 'some default') | |
def get(self, key, default): | |
if key in self.__dict.keys(): |
This file contains 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
# First Request | |
FINE: 2014-05-31 23:54:40.110: Received request for: /api/skeletons/53897b2b27574c6f54b8b | |
FINER: 2014-05-31 23:54:40.126: Invoking interceptor: projectx.handleResponseHeader | |
FINER: 2014-05-31 23:54:40.128: Invoking interceptor: projectx.dbConnInterceptor | |
FINER: 2014-05-31 23:54:40.172: Preparing to execute target: projectx.SkeletonsController.getOne | |
FINER: 2014-05-31 23:54:40.173: Invoking target projectx.SkeletonsController.getOne | |
ID redstone reports: 53897b2b27574c6f54b8b | |
FINER: 2014-05-31 23:54:40.175: Writing response for target projectx.SkeletonsController.getOne | |
FINER: 2014-05-31 23:54:40.180: Closed request for: /api/skeletons/53897b2b27574c6f54b8b |
This file contains 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 'dart:math'; | |
List generate_array(int qty) { | |
List tmp = new List(); | |
var rng = new Random(); | |
print("Generating $qty numbers..."); | |
for (var i = 0; i < qty; i++) { | |
tmp.add(rng.nextInt(10000000)); |
This file contains 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
app.directive('swMake', function() { | |
/* | |
Example: | |
<div sw-make sw-off="Inactive" sw-on="Active" ng-model="switchtest"></div> | |
*/ | |
return { | |
restrict: 'A', | |
require: 'ngModel', |
NewerOlder