Skip to content

Instantly share code, notes, and snippets.

View gearnode's full-sized avatar

Bryan FRIMIN gearnode

View GitHub Profile
@gearnode
gearnode / haproxy.conf
Last active November 25, 2021 16:17
parse haproxy log message with syslog-ng
global
daemon
maxconn 3000
defaults
timeout connect 10s
timeout client 30s
timeout server 30s
mode http
@gearnode
gearnode / main.go
Created April 2, 2018 16:32
haveSumWithPair
package main
import (
"fmt"
)
func haveSumWithPair(list []int, sum int) bool {
i := 0
y := len(list) - 1
@gearnode
gearnode / Form.jsx
Last active February 17, 2018 21:33
Generic React AJAX Form
import React, { Component } from 'react'
import PropTypes from 'prop-types';
import FormObject from './FormObject'
export default class Form extends Component {
static propTypes = {
method: PropTypes.string.isRequired,
action: PropTypes.string.isRequired,
encType: PropTypes.string.isRequired,

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@gearnode
gearnode / config.yml
Last active March 31, 2017 12:04
CircleCI 2.0 configuration for elixir umbrella with phoenix
version: 2
jobs:
build:
working_directory: /home/safeguard
docker:
- image: elixir:1.4.1
environment:
- MIX_ENV: test
- image: postgres:9.6
steps:
@gearnode
gearnode / progress_bar.rb
Created December 27, 2015 14:35 — forked from kuntoaji/progress_bar.rb
Simple progress bar script without Gem using Ruby.
#!/usr/bin/env ruby
progress = 'Progress ['
1000.times do |i|
# i is number from 0-999
j = i + 1
# add 1 percent every 10 times
if j % 10 == 0
# script
ruby -r json -e 'STDIN.each { |res| puts JSON.pretty_generate(JSON.parse(res)) }'
#usecase
curl -X GET "http://api.gearnode.com" | ruby -r json -e 'STDIN.each { |res| puts JSON.pretty_generate(JSON.parse(res)) }'
@gearnode
gearnode / Gemfile
Created November 1, 2015 00:16 — forked from gvarela/Gemfile
web sockets with eventmachine and redis pub/sub
# A sample Gemfile
source "http://rubygems.org"
gem "redis"
gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git'
gem "em-hiredis"
# gem "em-synchrony"
gem "em-websocket"
@gearnode
gearnode / tool
Last active August 29, 2015 14:24
require all ruby files in one directory
# Require all
def require_all path
global = File.join(File.dirname(__FILE__), path, '*.rb')
Dir[global].each do |file|
require file
end
end