Skip to content

Instantly share code, notes, and snippets.

View fivetwentysix's full-sized avatar
💭
yet another programmer

Patrick Ma fivetwentysix

💭
yet another programmer
View GitHub Profile
const path = require('path');
const glob = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = (env, options) => ({
optimization: {
minimizer: [
pma@miner1:~$ clinfo
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
Number of platforms: 2
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 2.0 AMD-APP (2348.3)
Platform Name: AMD Accelerated Parallel Processing
➜ ~ nmap 172.20.10.0/24
Starting Nmap 6.47 ( http://nmap.org ) at 2015-04-29 10:22 PDT
Nmap scan report for 172.20.10.1
Host is up (0.00092s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
21/tcp open ftp
62078/tcp open iphone-sync
apt_repository 'postgresql-9.3' do
uri 'http://ppa.launchpad.net/chris-lea/postgresql-9.3/ubuntu'
distribution 'precise'
components ['main']
keyserver 'keyserver.ubuntu.com'
key 'D878D6C2'
deb_src true
end
execute 'apt-key-update' do
@fivetwentysix
fivetwentysix / gist:e0f97330d5ab1fb5ea73
Last active August 29, 2015 14:03
This sorting code runs really slow after sorting a few times!
DemoApp.PlayersShowController = Ember.ObjectController.extend
needs: 'application'
filteredMatches: ( ->
hero_id = @get('model.filters.hero_id')
if hero_id
@get('model.matches').filterBy('hero_id', hero_id)
else
@get('model.matches')
).property('model.filters.hero_id')
DemoApp.PlayersRoute = Ember.Route.extend
model: ->
Ember.$.getJSON '/players'
DemoApp.PlayersShowRoute = Ember.Route.extend
model: (params) ->
Ember.$.getJSON '/players/' + params.id
DemoApp.PlayersShowRoute = Ember.Route.extend
model: (params) ->
Ember.$.getJSON '/players/' + params.id
DemoApp.PlayersShowController = Ember.ObjectController.extend
needs: 'application'
matches: (->
swords = []
# doesn't work ...
controllers.application.swordsPromise.then (data) ->
heroes = data
...
DemoApp.PlayersShowRoute = Ember.Route.extend
model: (params) ->
Ember.$.getJSON '/players/' + params.id
DemoApp.PlayersShowController = Ember.ObjectController.extend
swords: Ember.$.getJSON '/swords'
matches: (->
@get('model.matches').map (match) ->
sword = swords.findBy('external_id', match.sword_id)
name = sword.name.replace('lalala_', '')
match.sword =
img: "/images/sword_#{name}_sb.png"