Skip to content

Instantly share code, notes, and snippets.

View RubyRonin's full-sized avatar

Ruby Ronin RubyRonin

View GitHub Profile
.redgradient {
font-weight: bold;
color: white;
background: red; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(left, red , #CD0101); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(right, red, #CD0101); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(left, red, #CD0101); /* For Firefox 3.6 to 15 */
background: linear-gradient(to right, red , #CD0101); /* Standard syntax (must be last) */
}
constructor() {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
this.storage.get('isLoggedIn').then((val) => {
if (val == true) {
<!DOCTYPE html>
<html>
<head>
<title>Blog</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
test() {
this.http.get("https://myapi.com/?question=3", {headers: headers})
.map(res => res.json()).subscribe(data => {
this.rcvdpayload = data.data.children; console.log(this.rcvdpayload);
}, error => {
console.log(JSON.stringify(error.json()));
});
}
@RubyRonin
RubyRonin / controller.js
Created November 23, 2015 03:09
how to update screen
myApp.controller("ListTicketsCtrl", function($scope, $http) {
$http.get('https://example.com/tickets/')
.then(function(response){
$scope.tickets = response.data;
console.log(response.data);
});
$scope.removeItem = function(id){
$http.delete("https://example.com/tickets/" + id)
<div class="page-header">
<h1>List Tickets</h1>
</div>
<div ng-controller="ListTicketsCtrl">
<ul>
<li ng-repeat="ticket in tickets"><b>Name:</b> {{ticket.name}} <b>Phone:</b> {{ticket.phone}} <b>Email:</b> {{ticket.email}} <b>Gym Rep:</b> {{ticket.gymrep}} ID: {{ticket._id}} | <a href ng-click="removeItem()">Delete</a> </li>
</ul>
echo "<p>My Json objects:</p>";
$url="http://jsonplaceholder.typicode.com/posts";
$json = file_get_contents($url);
$data = json_decode($json, TRUE);
echo $data[0];
<?php
$response = http_get("http://www.example.com/", array("timeout"=>1), $info);
print_r($info);
?>
;(function($) {
$.fn.fixMe = function() {
return this.each(function() {
var $this = $(this),
$t_fixed;
function init() {
$this.wrap('<div class="container" />');
$t_fixed = $this.clone();
$t_fixed.find("tbody").remove().end().addClass("fixed").insertBefore($this);
resizeFixed();
passport.use('custom-login', new Custom(function (req, done) {
var email = req.param('email'),
pw = req.param('password');
User.findOne({"local.email": email}, function (err, usr) {
if (err){
console.log(err);
return done(err);
}
if (!usr)
{