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
"use strict" | |
topOfElement = (element) -> | |
if element then element.offsetTop + topOfElement(element.offsetParent) else 0 | |
ScrollList = React.createClass | |
getDefaultProps: -> | |
cssclass: '' | |
limit: 10 | |
offset: 150 |
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
## Data Service | |
myApp.provider 'dataService', -> | |
data = | |
content: [] | |
currentIndex: -1 | |
error: false | |
filter: 'list' | |
infiniteBusy: false | |
loading: 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
@keyframes bounceIn { | |
from, 20%, 40%, 60%, 80%, 100% { | |
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); | |
} | |
0% { | |
opacity: 0; | |
transform: scale3d(.3, .3, .3); | |
} | |
20% { | |
transform: scale3d(1.1, 1.1, 1.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
"use strict" | |
ImageLoader = React.createClass | |
displayName: 'ImageLoader' | |
propTypes: | |
altSrc: React.PropTypes.string | |
attributes: React.PropTypes.object | |
className: React.PropTypes.string | |
onError: React.PropTypes.func |
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
angular.module('MyApp').controller('MyController', ['$scope', function ($scope) { | |
$scope.data = [1, 2, 3]; | |
$scope.action = function () { | |
console.log('surprise motherfucker!'); | |
}; | |
}]); | |
angular.module('MyApp').controller('MyControllerImpl', ['$scope', '$controller', | |
function ($scope, $controller) { |
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
# config/initializers/compression.rb | |
Rails.application.configure do | |
# Use environment names or environment variables: | |
# break unless Rails.env.production? | |
break unless ENV['ENABLE_COMPRESSION'] == '1' | |
# Strip all comments from JavaScript files, even copyright notices. | |
# By doing so, you are legally required to acknowledge | |
# the use of the software somewhere in your Web site or app: |
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 | |
$filename = 'IMAGE_PATH'; | |
$image = imagecreatefromjpeg($filename); | |
$width = imagesx($image); | |
$height = imagesy($image); | |
$pixel = imagecreatetruecolor(1, 1); | |
imagecopyresampled($pixel, $image, 0, 0, 0, 0, 1, 1, $width, $height); | |
$rgb = imagecolorat($pixel, 0, 0); | |
$color = imagecolorsforindex($pixel, $rgb); | |
?> |
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
try { | |
window.localStorage.setItem('testKey', '1'); | |
window.localStorage.removeItem('testKey'); | |
} | |
catch (error) { | |
window.localStorage = { | |
_data: {}, | |
setItem: function(id, val) { return this._data[id] = String(val); }, | |
getItem: function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; }, | |
removeItem: function(id) { return delete this._data[id]; }, |
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
# Packages | |
*.xpi | |
*.zip | |
# Logs and databases | |
*.log | |
*.sql | |
*.sqlite | |
# OS generated files |
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 bash | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} |
OlderNewer