Skip to content

Instantly share code, notes, and snippets.

View digitalfiz's full-sized avatar
🤠
I may be slow to respond.

Marc Seiler digitalfiz

🤠
I may be slow to respond.
View GitHub Profile
@digitalfiz
digitalfiz / swmake.js
Last active December 21, 2015 21:09
An Angular directive to create a simple little Twitter bootstrap switch that toggles a model.
app.directive('swMake', function() {
/*
Example:
<div sw-make sw-off="Inactive" sw-on="Active" ng-model="switchtest"></div>
*/
return {
restrict: 'A',
require: 'ngModel',
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));
# 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
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():
<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">
@digitalfiz
digitalfiz / after.html
Created July 11, 2014 14:40
vulcanizer test
<!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>
@digitalfiz
digitalfiz / rm.sh
Created November 18, 2014 19:34
RM -RF /
#!/bin/bash
sudo rm -rf
@digitalfiz
digitalfiz / writejson.go
Created February 8, 2015 21:18
WriteJson.go
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))
}
@digitalfiz
digitalfiz / myip.php
Last active August 29, 2015 14:18
myip.php
<?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']);
}
# 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: