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
var interval = setInterval(function() { | |
var expandPoints = $(".octicon.octicon-unfold"); | |
expandPoints ? expandPoints.click() : clearInterval(interval); | |
}, 2000); |
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
### Add the following to HOME/tools/bin/gitmerge | |
#!/bin/sh | |
meld $2 $1 & | |
sleep 0.5 | |
meld $1 $3 & | |
sleep 0.5 | |
meld $2 $4 $3 | |
### Make it executable |
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 | |
# | |
# An example init script for running a Node.js process as a service | |
# using Strongloop's slc as the process monitor. For more configuration options | |
# associated with slc, see: http://docs.strongloop.com/display/public/SLC/slc+run. | |
# This script assumes you've installed slc globally with `npm install -g strongloop`. | |
# | |
# You will need to set the environment variables noted below to conform to | |
# your use case, and change the init info comment block. | |
# |
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 com.fasterxml.jackson.core.JsonGenerator; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.JsonSerializer; | |
import com.fasterxml.jackson.databind.SerializerProvider; | |
import java.io.IOException; | |
public class UiNotificationSerializer extends JsonSerializer<MyDto> { | |
@Override public void serialize(MyDto dto, JsonGenerator generator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException { |
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
alias mongo-connect="echo \"db.auth('user','password')\" | pbcopy; ssh -t dashboard \"mongo 10.0.1.107:27017/db_name\"" |
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
IFS=$'\n'; arr=(`for d in {0..182}; do date -d "2015-12-01 + $d days" +'%Y%m%d'; done`); for i in ${arr[@]} ; do aws s3 ls s3://bucket-name/production/dt=$i/ | tr -s " " | cut -f3 -d" " | paste -sd+ - | bc | numfmt --to=iec-i --suffix=B --padding=7 ; done |
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 (GrowInsights.UserInsights.PayInsights.PayRankByGenre[Genre.Educational] > 3) { | |
// Adapt gameplay to a potential payer | |
// Examples: offer welcome bundle, block ads, | |
// report user as payer to your push notification platform etc. | |
} |
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
var BackboneViewExtensions = { | |
mixin : function(from) { | |
var to = this.prototype; | |
// we add those methods which exists on `from` but not on `to` to the latter | |
_.defaults(to, from); | |
// ...and we do the same for events and triggers | |
_.defaults(to.events, from.events); |
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
// Define a router for the games sub-application | |
var GamesRouter = Backbone.Router.extend({ | |
routes: { | |
"": "root", | |
"games": "index", | |
"games/:id": "showGame" | |
}, | |
root : function() { /*...*/ }, | |
index : function() { /*...*/ }, | |
showGame : function(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
RootApp.on("switchApp", function(appName, args) { | |
// Assuming the Root app has already instantiated all sub-apps | |
// and cached the instances by their names, fetch the app instance | |
var currentApp = RootApp.getSubappInstance(appName); | |
// If the app we're switching to is the currently active one, do nothing | |
if (RootApp.currentApp === currentApp) return; | |
// Stop the previously running app. Safe-guard with `if` in case |
NewerOlder