Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Jefferson Raga Salunga jrsalunga

I may be slow to respond.
View GitHub Profile
jrsalunga / App\Http\Controllers\Auth\AuthController.php
Created Sep 15, 2015
Laravel 5.1 - Log in with Username or Email
View App\Http\Controllers\Auth\AuthController.php
* This snippet goes into your
* \app\Http\Controllers\Auth\AuthController.php
* Handle a login request to the application.
View designer.html
<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="my-element">
View designer.html
<link rel="import" href="../core-pages/core-pages.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-header-panel/core-header-panel.html">
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">
View designer.html
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
:host {
position: absolute;
View modal-populate
if(k.match(/id$/) && k.length > 2){ // eg: "userid" no "id"
var s = k.split('id')[0];
this.$el.find(".table-model #"+s+".search").val(this.model.get(k));
if(key.substr(key.length - 2) === 'id'){
$(".table-model").find('#'+key+' option[value='+data[key]+']').attr('selected', 'selected');
View Collection-inside-Model
var Document = Backbone.Model.extend({
constructor: function() {
this.items = new ItemSet(null, {document: this});
this.items.on('change',, this);
Backbone.Model.apply(this, arguments);
parse: function(resp) {
this.items.set(resp.items, {parse: true, remove: false});
delete resp.items;
return resp;
jrsalunga / getHoursAMPM
Last active Dec 20, 2015
Javascript Date functions: 1. Get AM/PM Hours 2. Get current day number of current year 3. Get current date. format: yyyy-mm-dd
View getHoursAMPM
Date.prototype.getHoursAMPM = function() {
var date = new Date();
var hours = date.getHours();
hours = hours % 12;
hours = hours ? hours : 12;
return hours;

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:


jrsalunga / gist:4507054
Created Jan 11, 2013
How To Work With Transparent Colors And Images In CSS Think about a div with a few paragraphs inside. Maybe you want the background of the div to be semi-transparent to allow what’s behind it to show through. Odds are you’d still like the text inside to be fully opaque so it’s easily read. However, because the paragraphs are children of the div,…
View gist:4507054
.element {
.element:before {
jrsalunga / #_no_click
Created Sep 25, 2012
jquery code to prevent hash(#) view in url when clicking <a href='#'>
View #_no_click
//$(this).css('border','1px red solid');
You can’t perform that action at this time.