Skip to content

Instantly share code, notes, and snippets.

@srsgores
srsgores / _power-select.pcss
Created Feb 17, 2019
Ember power select for postcss
View _power-select.pcss
:root {
/* Backgrounds --ember-power-select-background-color: #ffffff; */
--ember-power-select-disabled-background-color: #eeeeee;
--ember-power-select-multiple-selection-background-color: #e4e4e4;
--ember-power-select-highlighted-background: #5897fb;
--ember-power-select-selected-background: #dddddd;
--ember-power-select-text-color: inherit;
/* Texts --ember-power-select-text-color: inherit; */
--ember-power-select-placeholder-color: #999999;
@srsgores
srsgores / remove-facebook-ads.js
Created Apr 19, 2018
Remove facebook sponsored ads
View remove-facebook-ads.js
"use strict";
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
const observer = new MutationObserver(function(mutations, observer) {
const sponsoredRegex = /[S][sponred]*/;
mutations.filter((mutation) => mutation.target.textContent.split(sponsoredRegex).filter((match) => match === "").length >= 4).map((ad) => ad.target.remove());
});
@srsgores
srsgores / all_pokemon.sql
Last active Nov 11, 2017
Query pokemon data
View all_pokemon.sql
SELECT p.species_id, p.height, p.weight, p.base_experience, p.is_default, ps.*, pev.* FROM pokemon p
INNER JOIN pokemon_species ps on ps.id=p.id
INNER JOIN pokemon_evolution pev on pev.id=p.id
INNER JOIN pokemon_stats pstat on pstat.pokemon_id=p.id
@srsgores
srsgores / checkboxable-array.coffee
Created Nov 26, 2014
mixin used for checkboxable array
View checkboxable-array.coffee
CheckboxableArrayMixin = Ember.Mixin.create
allSelected: false
selectedItems: Ember.computed.filterBy("", "selected", true)
selectedItemsCount: Ember.computed.alias("selectedItems.length")
isEmpty: Ember.computed.not(@get("model"))
View girlfriend.coffee
###
Failure of mankind
girlfriend.coffee
@author Sean
@note Created on 2014-11-22 by Sean Goresht
@note uses Codoc
@see https://github.com/coffeedoc/codo
@srsgores
srsgores / dashboard.coffee
Created Nov 19, 2014
Authenticated route for a dashboard in EmberJS
View dashboard.coffee
`import Ember from "ember"`
DashboardRoute = Ember.Route.extend(
beforeModel: (transition) ->
loginController = @controllerFor("login")
unless loginController.get("isLoggedIn")
loginController.setProperties({
loginFailed: true
attemptedTransition: transition
})
View form-actions.coffee
`import Ember from "ember"`
FormActionsComponent = Ember.Component.extend(
save: null
classNames: "form-actions",
model: null
redirectRoute: "admin"
icon: "save"
iconClassName: (->
"icon-#{@get("icon")}"
@srsgores
srsgores / form-actions.hbs
Created Nov 13, 2014
form actions component
View form-actions.hbs
<footer {{bind-attr class="classNames"}}>
<button {{action "didSaveObject"}}>Save {{text}} <i {{bind-attr class="iconClassName"}}></i></button>
{{yield}}
</footer>
View flexbox-helpers.styl
flex()
-webkit-box-flex arguments[0]
-webkit-flex arguments
-moz-box-flex arguments[0]
-ms-flex arguments
flex arguments
$display-flex
display -webkit-box
display -webkit-flex
@srsgores
srsgores / helpers.styl
Created Aug 29, 2014
Trying to dynamically generate placeholders
View helpers.styl
use("camelize.js")
directions = top left bottom right
properties = margin padding
proportions = mini small normal medium large
positions = fixed absolute static relative
You can’t perform that action at this time.