This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scrape Flockler site articles and/or images to local files. | |
* | |
* Usage: | |
* $ bun fl-scrape.ts --get-articles --get-images | |
*/ | |
// change this to your Flockler site ID | |
const SITE_ID = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Diffs the bundles of a branch with master. | |
# | |
BRANCH=$1 | |
# Don't build master if we already have it | |
if [ ! -d "build_master" ]; then | |
echo 'Building "master" branch bundle...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
database: | |
override: | |
- mv config/database.ci.yml config/database.yml | |
- RAILS_ENV="test" RACK_ENV="test" bundle exec rake db:create db:structure:load ts:configure ts:index ts:start --trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sometimes it's necessary to do a bit of clean-up | |
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) { | |
el.removeAttribute('data-confirm'); | |
el.click(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
init() { | |
this._super(...arguments); | |
console.log('init!!1'); | |
}, | |
willDestroy() { | |
console.log('noooo dsetroyer'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Encrypts a "secrets.json" file using mcrypt | |
* | |
* Usage: php secrets_encrypt.php > secrets.ejson | |
*/ | |
require(dirname(__FILE__) . '/key.php'); | |
function _secrets_encrypt($string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default DS.ActiveModelAdapter.extend({ | |
host: 'https://output.jsbin.com', | |
namespace: 'zufarix', | |
buildURL: function (modelName, id, snapshot, requestType, query) { | |
var url = this._super(modelName, id, snapshot, requestType, query); | |
url = url.replace('colors/', '') + '.json'; | |
return url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Helper for rendering a component dynamically by supplying a name. | |
NOTE: Only works on Ember.js 1.9 and lower, does not work on 1.10+. | |
Ember 1.11 will have this feature built-in. | |
Usage: {{render-component widgetName someData=some.data}} | |
*/ | |
Ember.Handlebars.registerHelper('render-component', function(context, options) { | |
var componentName = Ember.Handlebars.get(this, context, options); | |
var helper = Ember.Handlebars.resolveHelper(options.data.view.container, componentName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get value from a Sass list of key-value items (helper function) | |
@function match($collection, $key) { | |
@each $item in $collection { | |
$index: index($item, $key); | |
@if $index { | |
$return: if($index == 1, 2, $index); | |
@return nth($item, $return); | |
} | |
} | |
@return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if paginate && num_pages > 1 %> | |
<div class="pagination"> | |
<% if prev_page %> | |
<%= link_to '<i class="icon-arrow-left"></i> Prev', prev_page, class: 'prev page-numbers' %> | |
<% else %> | |
<span class="disabled"><i class="icon-arrow-left"></i> Prev</span> | |
<% end %> | |
<% for p in 1..num_pages %> | |
<% if p == page_number %> |
NewerOlder