Skip to content

Instantly share code, notes, and snippets.

View ayxos's full-sized avatar
🎯
Focusing

marco ayxos

🎯
Focusing
View GitHub Profile
@mangosmoothie
mangosmoothie / example.js
Last active May 28, 2022 08:37
redux-mock-store with redux-saga for testing actions / sagas
// https://github.com/arnaudbenard/redux-mock-store/issues/59#issuecomment-345741265
//------------- the saga ----------------
function* fetchSaga(action) {
try {
yield put({type: "FETCH_SUCCEEDED", data: "data"});
} catch (e) {
yield put({type: "FETCH_FAILED", message: e.message});
}
}
@renchap
renchap / README.md
Last active October 12, 2022 17:14
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@gandhiShepard
gandhiShepard / react-filter-map-example.js
Created September 25, 2015 15:44
React .filter and .map example
// via: Learn Raw React — no JSX, no Flux, no ES6, no Webpack…
// http://jamesknelson.com/learn-raw-react-no-jsx-flux-es6-webpack
var contacts = [
{key: 1, name: "James Nelson", email: "james@jamesknelson.com"},
{key: 2, name: "Bob"}
]
var listElements = contacts
.filter(function(contact) { return contact.email; })
@jrnk
jrnk / ISO-639-1-language.json
Last active April 30, 2024 14:09
ISO 639-1 Alpha-2 codes of languages JSON
[
{ "code": "aa", "name": "Afar" },
{ "code": "ab", "name": "Abkhazian" },
{ "code": "ae", "name": "Avestan" },
{ "code": "af", "name": "Afrikaans" },
{ "code": "ak", "name": "Akan" },
{ "code": "am", "name": "Amharic" },
{ "code": "an", "name": "Aragonese" },
{ "code": "ar", "name": "Arabic" },
{ "code": "as", "name": "Assamese" },
@chrisjlee
chrisjlee / wp.sh
Created August 6, 2012 21:24 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script
#!/bin/bash
echo “Database Name: ”
read -e dbname
echo “Database User: ”
read -e dbuser
echo “Database Password: ”
read -s dbpass
echo “run install? (y/n)”
read -e run
if [ "$run" == n ] ; then
@otanistudio
otanistudio / chat-frontend.js
Created June 2, 2012 04:45 — forked from martinsik/chat-frontend.js
Node.js chat server, with the frontend changed to use BackboneJS
/*global $, Backbone, window, console, WebSocket, _ */
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var $content = $('#content')
, $input = $('#input')
, $status = $('#status')
// my color assigned by the server
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
namespace.views.MyWizard = Backbone.Views.extend({
initialize: function() {
_.bindAll(this, 'render', 'wizardMethod');
}
render: function() {
this.wizardMethod();
return this;
},