- install npm packages
- update brunch-config.js
- rename web/static/css/app.css to web/static/css/app.scss
- update web/static/css/app.scss
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 UploadAdapter from './upload_adapter'; | |
function CustomUploadAdapterPlugin( editor ) { | |
editor.plugins.get( 'FileRepository' ).createUploadAdapter = ( loader ) => { | |
// Configure the URL to the upload script in your back-end here! | |
return new UploadAdapter( loader, editor ); | |
}; | |
} | |
import { Controller } from "stimulus" |
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
/* | |
This snippet is esssentially the same as being in the Twitter longer tweets test, for tweetdeck. | |
The Tweet length counter is fixed by tricking TweetDeck into counting up to 140 characters, twice, so you'll see 140 | |
instead of 280 in the counter but going over 140 will give you another set of 140 charactrs. | |
*/ | |
TD.services.TwitterClient.prototype.makeTwitterCall=function(b,e,f,g,c,d,h){c=c||function(){};d=d||function(){};b=this.request(b,{method:f,params:Object.assign(e,{weighted_character_count:!0}),processor:g,feedType:h});return b.addCallbacks(function(a){c(a.data)},function(a){d(a.req,"",a.msg,a.req.errors)}),b}; | |
twttrTxt=Object.assign({},twttr.txt,{isInvalidTweet:function(){return!1},getTweetLength:function(x){return x=twttr.txt.getTweetLength.apply(this,arguments),x<140||x/140>2?x:x%140}}); |
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
#include <FastLED.h> | |
// fadeTowardColor example code. | |
// | |
// Sample code that includes a function for fading one RGB color toward a target RGB color | |
// Also includes a function for fading a whole array of pixels toward a given color | |
// | |
// Both of these functions _modify_ the existing color, in place. | |
// | |
// All fades are done in RGB color space. |
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 "phoenix_html" | |
import "bootstrap" | |
import "jquery" | |
import "toastr" | |
// ... |
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
#!/usr/bin/env perl | |
# | |
# Find unused CSS selectors by crawling a list of URLs | |
# (--url, even more than one) and matching all elements in | |
# a page to find out which selectors are never used across | |
# all given URLs | |
# | |
# Usage: | |
# ./find-unused-css-selectors.pl --css file.css --url http://some.url [--url http://some.other.url ...] | |
# |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
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
class Avatar < ActiveRecord::Base | |
attr_accessor :content_type, :original_filename, :image_data | |
before_save :decode_base64_image | |
has_attached_file :image, | |
PAPERCLIP_CONFIG.merge( | |
:styles => { | |
:thumb => '32x32#', | |
:medium => '64x64#', |
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
# Backbone CoffeeScript Helpers by M@ McCray. | |
# Source: http://gist.github.com/625893 | |
# | |
# Use Backbone classes as native CoffeeScript classes: | |
# | |
# class TaskController extends Events | |
# | |
# class TaskView extends View | |
# tagName: 'li' | |
# @SRC: '<div class="icon">!</div><div class="name"><%= name %></div>' |
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
/* | |
The MIT License (MIT) | |
Copyright (c) 2014 Ismael Celis | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
NewerOlder