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
#!/bin/bash | |
# Stop docker containers if exists | |
names=$(docker ps --format "{{.Names}}") | |
if [ ! -z "$names" ] | |
then | |
printf "\n\e[1;31mKilling the following containers:\e[0m\n\n" | |
while read -r 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
#!/bin/bash | |
# Stop docker containers if exists | |
names=$(docker ps --format "{{.Names}}") | |
if [ ! -z "$names" ] | |
then | |
printf "\n\e[1;31mKilling the following containers:\e[0m\n\n" | |
while read -r 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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
if ( session_status() == PHP_SESSION_NONE ) { | |
session_start(); | |
} | |
// Autoload the required files | |
require_once( APPPATH . 'libraries/vendor/autoload.php' ); | |
use Facebook\FacebookRedirectLoginHelper; |
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 | |
// Returns the value of the expression, take care if you use isset or some function who evaluate the variable | |
// because will return true or the response of the function. | |
$x = "Hey"; | |
echo $x ?: "The variable doesn't exist"; | |
echo (isset($y) ?: "The variable doesn't exist"); |
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
/* Nh?c */ | |
var parent = document.getElementsByTagName("html")[0]; | |
var _body = document.getElementsByTagName('body')[0]; | |
var _div = document.createElement('div'); | |
_div.style.height = "25"; | |
_div.style.width = "100%"; | |
_div.style.position = "fixed"; | |
_div.style.top = "auto"; | |
_div.style.bottom = "0"; | |
_div.align = "center"; |
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
package com.nevacom.vigi.intface; | |
public interface Callback<T> { | |
public void invoke(T arg); | |
} |
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
console.log "Magic Start Here" | |
casper = require('casper').create() | |
casper.start "http://facebook.com", -> | |
@echo "Loggin... " | |
@fill "form[id='login_form']", { email: "[email protected]", pass: "yourpassword", persistent: true }, true | |
@capture 'facebook.png' | |
casper.then -> | |
@echo 'Profile... ' |
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
# Thanks to: http://stackoverflow.com/questions/8566667/split-javascript-array-in-chunks-using-underscore-js | |
_.mixin | |
chunk: (array, unit) -> | |
result = _.groupBy array, (element, index) -> | |
Math.floor index / unit | |
_.toArray result | |
data = [1,2,3,4,5,6,7,8,9] | |
# We pass the array and the size of the chunk | |
list = _.chunk data, 2 |
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
ALGRAF = angular.module('algraf', ['ui.state']) | |
ALGRAF.config ($routeProvider, $interpolateProvider, $stateProvider) -> | |
$interpolateProvider.startSymbol('{[') | |
$interpolateProvider.endSymbol(']}') | |
$stateProvider | |
.state 'index' | |
url: '/' | |
views: |