Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Install Nginx with fast-cgi support.
# Author: @claxch
# Warning: PROJECT_NAME, DOMAIN, SSL must be set as env variables.
# OS: deb
[ ! $EUID -eq 0 ] && echo 'Not root.' && exit
[[ \
-z `env | grep -oE PROJECT_NAME=` || -z $PROJECT_NAME || \
@kkarimi
kkarimi / Lesson3.md
Last active January 21, 2017 11:20

React Session #3

  • Review: Load API in to state
  • Good practices:
    • uses container / parent components
  • React-Router: Basics
  • Eco-system: Webpack/babel
  • Uni-directional flow: Intro to Redux
  • Mention React Native / Electron
  • Unit testing
  • testing components - Jest?
function displayOrganisations(organisation) {
document.getElementById('pp').innerHTML += '<br />' + organisation + '<br />';
}
function getAreaServices(areaName) {
var http = new XMLHttpRequest;
http.open('GET', "https://code-your-future.github.io/api-demo/area/" + areaName + "/index.json");
http.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
var myData = JSON.parse(http.responseText);

Keybase proof

I hereby claim:

  • I am kkarimi on github.
  • I am kkarimi (https://keybase.io/kkarimi) on keybase.
  • I have a public key ASAlynBiaT9KiGXyetrWnTg4yYNjnfLBSBIwJBE6tF0CKAo

To claim this, I am signing this object:

@kkarimi
kkarimi / gist:2d2ef7c7d5a4f502bfd39fd3bf385155
Created August 3, 2016 10:14 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@kkarimi
kkarimi / test.py
Created March 22, 2016 15:49
python selenium test example
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
(function() {
if (! window.jQuery ) {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'; // you can change this url by latest jQuery version
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(s);
}
}());
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</head>
<body>
<p>A2Dominion<br>
113 Uxbridge Road<br>
London, W5 5TL<br>
0800 432 0077<br>
<a href="http://www.a2dominion.co.uk/">http://www.a2dominion.co.uk/</a>
var React = require('react');
var WeaponList = React.createClass({
render: function() {
return (<ul className="list-unstyled">
<li>
<Weapon name="flail" attrs={["1d8 bludgeoning;"]} />
</li>
<li>
@kkarimi
kkarimi / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console