Skip to content

Instantly share code, notes, and snippets.

View matsko's full-sized avatar

Matias Niemelä matsko

View GitHub Profile
isUniqueChars(String str) {
if (str.length() > 256) return false;
int checker = 0;
for (int i = 0; i < str.length(); i++) {
int val = str.charAt(i) - 'a';
if ((checker & (i << val)) > 0) {
return false;
}
checker |= (1 << val);
<!-- this is the directive -->
<div ng-include ng-animate="enter: enter" style="-webkit-transition: 1s linear all">
<div class="ng-animate-enter-setup ng-animate-enter-start">
<!-- this is the template HTML -->
<div>….</div>
</div>
</div>
/**
* @ngdoc function
* @name ng.animator#hide
* @methodOf ng.$animator
*
* @description
* Starts the hide animation first and sets the CSS `display` property to `none` upon completion.
*
* @param {jQuery/jqLite element} element the element that will be rendered visible or hidden
*/
.factory('appLoading', function($rootScope) {
var timer;
return {
loading : function() { // this is the line that gets called when you appLoading.loading(), right?
Yes. This gets called whenever I want the page to indicate a loading operation. loading() starts sets the animatio flag
which starts the animation icon loading at the top of the app.
clearTimeout(timer);
$rootScope.status = 'loading';
@matsko
matsko / damyan.rb
Last active December 17, 2015 01:08
class Damyan
def self.come_out
@come_out_response ||= "No sorry not this time"
end
end
class Damyan
def self.come_out
if @come_out_response.nil?
if(false)
@come_out_response = "Sure! Lets do it!"
else
@come_out_response = "No sorry not this time"
end
end
echo "hello"
<div ng-animate="{misko:'animation-name'}" ng-class="{misko:$index == 0}"></div>
animator.animate('ng-hide-add', element).then(function() {
addClass('ng-hide');
});
<style>
//CSS
.show-hide.ng-hide-add,
.show-hide.ng-hide-remove {
transition:0.5s linear all;
-webkit-transition:0.5s linear all;
-moz-transition:0.5s linear all;
-o-transition:0.5s linear all;
display:block!important;
}