Skip to content

Instantly share code, notes, and snippets.

Avatar

Ruby Ronin RubyRonin

View GitHub Profile
View ff
.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) */
}
View app.component.ts
constructor() {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
this.storage.get('isLoggedIn').then((val) => {
if (val == true) {
View application.html.erb
<!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>
View service.ts
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 Nov 23, 2015
how to update screen
View controller.js
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)
View gist:e04576e90cb3ec7941a8
<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>
View test.php
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];
View http.php
<?php
$response = http_get("http://www.example.com/", array("timeout"=>1), $info);
print_r($info);
?>
View test.js
;(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();
View passporterrorlog.js
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)
{