Skip to content

Instantly share code, notes, and snippets.

View obonyojimmy's full-sized avatar
💻
probably coding

jimmycliff obonyo obonyojimmy

💻
probably coding
View GitHub Profile
package main
import (
"log"
"syscall"
)
func htonsInt16(n int) int {
return int(int16(byte(n))<<8 | int16(byte(n>>8)))
}
@obonyojimmy
obonyojimmy / recursive-render.html
Created March 15, 2018 04:08 — forked from nkvenom/recursive-render.html
React Example Render Recursive Function
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Recursive Rendering in React</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
</head>
<body>
@jasoet
jasoet / .eslintrc.js
Created May 11, 2016 01:03 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@victusfate
victusfate / aws-sns-example.js
Last active July 19, 2018 06:23 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@gssbzn
gssbzn / yarm.config
Last active October 30, 2018 18:57
Elastic Beanstalk Rails+Webpacker extension
# Copyright 2018 SwiftComply.com
commands:
01_node_install:
test: "[ `node --version` != 'v8.10.0' ]"
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -"
02_yarn_repo:
test: "[ ! -f /etc/yum.repos.d/yarn.repo ]"
command: "curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo"
03_yarn_install:
test: "[ ! -x /usr/bin/yarn ]"
@wizact
wizact / aws_mongo.sh
Created January 16, 2016 11:48
Preparing and running an aws instance for Mongo
#!/bin/bash
set -e
install_mongo() {
sudo yum -y update
echo "[MongoDB]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
@obonyojimmy
obonyojimmy / aws_mongo.sh
Created November 20, 2018 00:01 — forked from wizact/aws_mongo.sh
Preparing and running an aws instance for Mongo
#!/bin/bash
set -e
install_mongo() {
sudo yum -y update
echo "[MongoDB]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
@miku
miku / .gitignore
Last active December 8, 2018 03:43
Golang XML worker queue example
xmlp
@8lane
8lane / functions.php
Created March 31, 2014 10:46
Limit number of cross sells items on cart page in WooCommerce
add_filter('woocommerce_cross_sells_total', 'cartCrossSellTotal');
function cartCrossSellTotal($total) {
$total = '3';
return $total;
}
@nnnikolay
nnnikolay / fix-npm.config
Last active May 13, 2019 21:19
Not the final AWS Elastic Beanstalk deployment for NodeJS. Why not the final? some parts are missing or not tested, like configuration changes. Currently it has been tested for application deployment only.
files:
"/opt/elasticbeanstalk/env.vars":
mode: "000775"
owner: root
group: users
content: |
# enable extra logs
set -xe
# Defines variables for use by the other scripts below.