Skip to content

Instantly share code, notes, and snippets.


Isaac Ben Hutta itzikbenh

View GitHub Profile
BenBroide /
Last active Oct 10, 2017
Turn c9 WordPress workspace server "ON" and paste this bash code in the c9 ide terminal and click "enter"
#turn workspace server on ( "RUN" button), paste this into c9 terminal, and hit "enter"
cat >$SETUP_PATH <<'EOF'
curl -O
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
wp core install --url=https://$C9_HOSTNAME --title=QuickWP --admin_user=admin --admin_password=123456 --admin_email=$C9_EMAIL
wp option update my_option '{"site_url": "bar"}' --format=json
wp theme install twentyseventeen
markerikson / prepareActions.js
Created May 1, 2016
Redux prepareActions utility function
View prepareActions.js
import {bindActionCreators} from "redux";
import {connect} from "react-redux";
import {action1, action2} from "myActions";
// A reusable utility function that binds action creators
// and returns them as a prop named "actions"
function prepareActions(actions) {
return (dispatch) => ({
actions : bindActionCreators(actions, dispatch);
telekosmos / uniq.js
Last active Oct 7, 2021
Remove duplicates from js array (ES5/ES6)
View uniq.js
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
jonaslejon / Mailgun PHP API with curl
Last active Jul 31, 2021
Send mail with Mailgun API version 2 and PHP. Should also work with version 3 of the Mailgun API
View Mailgun PHP API with curl
define("DOMAIN", "");
define("MAILGUN_API", "XXX123"); // Mailgun Private API Key
function br2nl($string) {
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
function mg_send($to, $subject, $message) {
$ch = curl_init();
tobysteward / BlogController.php
Last active Jul 29, 2021
Laravel AJAX Pagination with JQuery
View BlogController.php
class BlogController extends Controller
* Posts
* @return void
public function showPosts()
2called-chaos /
Created Mar 3, 2013
enable nginx vim syntax highlighting (on Ubuntu/Debian)
mkdir -p ~/.vim/syntax/
cd ~/.vim/syntax/
mv download_script.php\?src_id\=19394 nginx.vim
cat > ~/.vim/filetype.vim <<EOF
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif