Skip to content

Instantly share code, notes, and snippets.

View v0ff4k's full-sized avatar
👀
Howdie....

Vladimir v0ff4k

👀
Howdie....
View GitHub Profile
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 5, 2024 06:09
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ivanpepelko
ivanpepelko / fann.stub.php
Last active April 26, 2022 13:13
PHP FANN stub for editors and IDEs
<?php
define('FANN_TRAIN_INCREMENTAL', 0);
define('FANN_TRAIN_BATCH', 1);
define('FANN_TRAIN_RPROP', 2);
define('FANN_TRAIN_QUICKPROP', 3);
define('FANN_TRAIN_SARPROP', 4);
define('FANN_LINEAR', 0);
define('FANN_THRESHOLD', 1);
define('FANN_THRESHOLD_SYMMETRIC', 2);
@thoriqmacto
thoriqmacto / PatternDAO_User.php
Created October 30, 2015 09:13
[PHP] Data Access Object Pattern Example
<?php
abstract class baseDAO{
private $__connection;
public function __construct(){
$this->_connectToDB(DB_USER, DB_PASS, DB_HOST, DB_DATABASE);
}
private function __connectToDB($user, $pass, $host, $database){
// transform cropper dataURI output to a Blob which Dropzone accepts
function dataURItoBlob(dataURI) {
var byteString = atob(dataURI.split(',')[1]);
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ab], { type: 'image/jpeg' });
}
@Ocramius
Ocramius / README.md
Last active January 22, 2024 00:09
`__invoke` vs `function` vs `Closure`
@kamranzafar
kamranzafar / toast.js
Created July 18, 2012 14:40
JQuery Mobile Android-style Toast popup
var toast=function(msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2 })
@stubbetje
stubbetje / gist:422106
Created June 2, 2010 08:28
flatten an multidimensional array and combine keys with separator
<?php
$flatten = function( $array , $keySeparator = '.' ) use ( & $flatten )
{
if( is_array( $array ) ) {
foreach( $array as $name => $value ) {
$f = $flatten( $value , $keySeparator );
if( is_array( $f ) ) {
foreach( $f as $key => $val ) {
$array[ $name . $keySeparator . $key ] = $val;