This file contains hidden or 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
| const mem = (fn) => { | |
| const cache = {} | |
| return (...args) => { | |
| if (cache[args]) { | |
| return cache[args] | |
| } | |
| const res = fn.apply(this, args) | |
| cache[args] = res | |
| return res |
This file contains hidden or 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
| export const flattner = array => { | |
| if (!Array.isArray(array)) { | |
| throw Error(`${array} is not an Array`) | |
| } | |
| for (let i = 0; i < array.length;) { | |
| let value = array[i] | |
| if (Array.isArray(value)) { | |
| if (value.length > 0) { | |
| value.unshift(i, 1) | |
| array.splice.apply(array, value) |
This file contains hidden or 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
| /** | |
| * jquery.mask.js | |
| * @version: v1.14.8 | |
| * @author: Igor Escobar | |
| * | |
| * Created by Igor Escobar on 2012-03-10. Please report any bug at http://blog.igorescobar.com | |
| * | |
| * Copyright (c) 2012 Igor Escobar http://blog.igorescobar.com | |
| * | |
| * The MIT License (http://www.opensource.org/licenses/mit-license.php) |
This file contains hidden or 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
| function solution($S) { | |
| $len = strlen($S); | |
| if(!$len){ | |
| return 0; | |
| } | |
| $data = str_split($S, 1); | |
| $datasize = count($data) + 1; | |
| $chunked = array_chunk($data, $datasize / 2); |
This file contains hidden or 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
| export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin | |
| eval "$(rbenv init -)" | |
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
| source ~/.git-completion.bash | |
| alias edit='open -a "Sublime Text 2"' | |
| alias mysql=/usr/local/mysql/bin/mysql | |
| alias mysqladmin=/usr/local/mysql/bin/mysqladmin | |
| # Bash completion | |
| if [ -f /etc/bash_completion ]; then |
This file contains hidden or 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 | |
| if [ "$1" == "" ]; then | |
| echo "Usage: $0 <database> [output-path] [user] [password] [server_address]" | |
| exit 1 | |
| fi | |
| if [ "$2" == "" ]; then | |
| echo "Usage: $0 <database> [output-path] [user] [password] [server_address]" | |
| exit 1 |
This file contains hidden or 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 | |
| db=$1 | |
| user=$2 | |
| passwd=$3 | |
| if [ "$db" = "" ]; then | |
| echo "Usage: $0 db_name user password" | |
| exit 1 | |
| fi | |
| clear | |
| for sql_file in *.sql; do |
This file contains hidden or 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 | |
| umask(0); | |
| ini_set('memory_limit','512M'); | |
| set_time_limit(0); | |
| if(file_exists('app/Mage.php')) require 'app/Mage.php'; | |
| else require '../../app/Mage.php'; | |
| // Init without cache so we get a fresh version | |
| Mage::app('admin','store', array('global_ban_use_cache' => TRUE)); | |
This file contains hidden or 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 is a basic VCL configuration file for varnish by Ideaspool. | |
| # | |
| # Default backend definition. Set this to point to your content | |
| # server. | |
| # | |
| backend default { | |
| .host = "192.168.0.116"; | |
| .port = "80"; | |
| } | |
| acl trusted { |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <link rel="selenium.base" href="http://localhost" /> | |
| <title>ExampleSeleniumLoop</title> | |
| </head> | |
| <body> | |
| <table cellpadding="1" cellspacing="1" border="1"> |