Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

appkr appkr

🎯
Focusing
View GitHub Profile
@wzed
wzed / guzzle_pool_example.php
Created Feb 8, 2017
GuzzleHttp\Pool example: identifying responses to concurrent async requests
View guzzle_pool_example.php
<?php
/*
* Using a key => value pair with the yield keyword is
* the cleanest method I could find to add identifiers or tags
* to asynchronous concurrent requests in Guzzle,
* so you can identify which response is from which request!
*/
$client = new GuzzleHttp\Client(['base_uri' => 'http://httpbin.org']);
View 0-CustomSerializationMain.java
package homo.efficio.json.jackson.custom.serialization;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import homo.efficio.json.jackson.custom.serialization.domain.CellPhone;
import homo.efficio.json.jackson.custom.serialization.domain.FamilyMember;
import homo.efficio.json.jackson.custom.serialization.domain.MobileVendor;
import homo.efficio.json.jackson.custom.serialization.serializer.CellPhoneSerializer;
import homo.efficio.json.jackson.custom.serialization.serializer.FamilyMemberSerializer;
@themsaid
themsaid / HasEnums.php
Last active Aug 29, 2020
PHP Enumerated Type
View HasEnums.php
trait HasEnums
{
/**
* The array of enumerators of a given group.
*
* @param null|string $group
* @return array
*/
static function enums($group = null)
{
@lesstif
lesstif / serve-php.sh
Last active Mar 21, 2021
nginx php-fpm virtual host serve script for RHEL/CentOS, Ubuntu distro. Run "curl -o serve-php.sh https://gist.githubusercontent.com/lesstif/82c107282241c7a52ad9/raw && sudo mv serve-php.sh /usr/local/bin/ && sudo chmod +x /usr/local/bin/serve-php.sh "
View serve-php.sh
#!/usr/bin/env bash
## Installation
## curl -o /usr/local/bin/serve-php.sh https://gist.githubusercontent.com/lesstif/82c107282241c7a52ad9/raw
## chmod +x /usr/local/bin/serve-php.sh
SA="/etc/nginx/sites-available/"
SE="/etc/nginx/sites-enabled/"
test=0
@appkr
appkr / Contract Killer 3.md
Created Feb 27, 2016 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@cmaas
cmaas / CastsValueObject.php
Last active Mar 21, 2020
A Trait to automatically cast value objects in Laravel without needing a Mutator and an Accessor.
View CastsValueObject.php
<?php
trait CastsValueObjects
{
protected function castAttribute($key, $value)
{
$castToClass = $this->getValueObjectCastType($key);
// no Value Object? simply pass this up to the parent
if (!$castToClass) {
return parent::castAttribute($key, $value);
@haje01
haje01 / TensorFlow 시작하기.md
Last active Nov 25, 2021
TensorFlow 시작하기
View TensorFlow 시작하기.md

텐서플로우 시작하기

글쓴이: 김정주(haje01@gmail.com)

이 문서는 텐서플로우 공식 페이지 내용을 바탕으로 만들어졌습니다.


소개

텐서플로우(TensorFlow)는 기계 학습과 딥러닝을 위해 구글에서 만든 오픈소스 라이브러리입니다. 데이터 플로우 그래프(Data Flow Graph) 방식을 사용하였습니다.

@nkt
nkt / Results.md
Last active Nov 4, 2021
ReactPHP vs Node.js
View Results.md

wrk -t4 -c400 -d10s http://127.0.0.1:1337/

PHP

Running 10s test @ http://127.0.0.1:1337/
  4 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.02ms    6.94ms  82.86ms   85.27%
@sheck
sheck / seti.css
Created Oct 18, 2015
Seti UI Theme for Pygments highlighting (jekyll, github pages)
View seti.css
.highlight .hll { background-color: #ffffcc }
.highlight { background: #151718; color: #d4d7d6; background-color: #151718 }
.highlight .c { color: #41535b; background-color: #151718 } /* Comment */
.highlight .err { color: #d4d7d6; background-color: #151718 } /* Error */
.highlight .esc { color: #d4d7d6; background-color: #151718 } /* Escape */
.highlight .g { color: #d4d7d6; background-color: #151718 } /* Generic */
.highlight .k { color: #9fca56; background-color: #151718 } /* Keyword */
.highlight .l { color: #d4d7d6; background-color: #151718 } /* Literal */
.highlight .n { color: #d4d7d6; background-color: #151718 } /* Name */
.highlight .o { color: #d4d7d6; background-color: #151718 } /* Operator */
@karpathy
karpathy / min-char-rnn.py
Last active Nov 27, 2021
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)