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
$regexpLastThirty = '#' . '(' . | |
/* | |
* regExp builder for this month | |
* d-m-Y m-d-Y Y-d-m Y-m-d | |
* d-m-y m-d-y y-d-m y-m-d | |
*/ | |
implode('|', array_map(function ($v) { | |
return | |
'(' . str_pad($v, 2, 0, STR_PAD_LEFT) . '[^:]?' . str_pad(date('m'), 2, 0, STR_PAD_LEFT) . '[^:]?' . date('Y') . ')' | |
. '|' . '(' . str_pad(date('m'), 2, 0, STR_PAD_LEFT) . '[^:]?' . str_pad($v, 2, 0, STR_PAD_LEFT) . '[^:]?' . date('Y') . ')' |
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
/** | |
* @param string $cmd Command to execute | |
* @return string Result | |
*/ | |
public function _exec($cmd) | |
{ | |
$res = ''; | |
if (!empty($cmd)) { | |
if (@function_exists('exec')) { | |
exec($cmd, $res); |
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 | |
#delete bash logs & disable logging on linux | |
export HISTFILE=/dev/null; | |
export HISTSIZE=0; | |
rm ~/.bash_history -rf; | |
history -c; |
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
{ | |
"tagname-lowercase": true, | |
"attr-lowercase": true, | |
"attr-value-double-quotes": true, | |
"attr-value-not-empty": true, | |
"attr-no-duplication": true, | |
"doctype-first": false, | |
"tag-pair": true, | |
"tag-self-close": false, | |
"spec-char-escape": true, |
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
objToFormData = (obj, formData, prefix) -> | |
formData ?= new FormData | |
formKey = null | |
angular.forEach obj, (val, key) -> | |
if prefix? | |
formKey = "#{prefix}[#{key}]" | |
else | |
formKey = key |
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
private static class Vertex { | |
private int uniqueLabel; | |
public Vertex(int uniqueLabel) { | |
super(); | |
this.uniqueLabel = uniqueLabel; | |
} | |
@Override | |
public boolean equals(Object obj) { |
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
brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered! | |
brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it. | |
brew install elixir | |
mix local.hex | |
createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw... | |
# Install the latest Phoenix. It will give us the command `mix phoenix.new` | |
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez |
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 React, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import Loading from '../Loading'; | |
export default class Image extends PureComponent { | |
static loadedSrcs = new Set(); | |
constructor(props, context) { | |
super(props, context); | |
this.state = { isLoaded: false, isLoading: false, error: null }; |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
function Loading({ size, fullScreen, isGold }) { | |
const style = { | |
borderWidth: `${size / 10}px`, | |
width: `${size}px`, | |
height: `${size}px`, | |
}; | |
if (fullScreen) { |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
function Loading({ size, fullScreen, isGold }) { | |
const style = { | |
borderWidth: `${size / 10}px`, | |
width: `${size}px`, | |
height: `${size}px`, | |
}; | |
if (fullScreen) { |
OlderNewer