Skip to content

Instantly share code, notes, and snippets.

View arvenil's full-sized avatar
💻
Looking for project

Kamil Dziedzic arvenil

💻
Looking for project
View GitHub Profile
@jaredwilli
jaredwilli / gist:752701
Created December 23, 2010 07:32
Constructor Overloading using the Php5 __call() method
<?php
/**
* @constructor overloading using the __call() function
*
*/
class Player {
private $name;
private $surname;
private $country;
@cowboy
cowboy / bad-bad-bad.js
Created October 15, 2011 14:44
Shitty destructors for JavaScript!
function Thing(context, name) {
this.context = context;
this.name = name;
this.init();
this.startTheWorstGarbageCollectorEver();
}
Thing.prototype.startTheWorstGarbageCollectorEver = function() {
var id = setInterval(function() {
if (!this.context[this.name]) {
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@samsalisbury
samsalisbury / .gitconfig
Last active June 22, 2022 19:30
Git diff and merge with p4merge (OSX)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
@lexrus
lexrus / disable_all_animation.sh
Created August 1, 2014 06:05
Disable all animations of OS X.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
@arvenil
arvenil / vercmps.sh
Last active August 29, 2015 14:04 — forked from livibetter/vercmp.sh
Fix for "08: value too great for base", works for versions with numbers only (no letters, no rc suffixes)
#!/bin/bash
# Copyright (c) 2012 Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
@gavinandresen
gavinandresen / BlockPropagation.md
Last active March 14, 2023 09:45
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@nickcarenza
nickcarenza / mycnf.go
Created January 30, 2017 22:31
Golang read connection details from my.cnf
package db
// stdlib
import (
"fmt"
"os"
)
// external
import (
@mattmc3
mattmc3 / modern_sql_style_guide.md
Last active May 22, 2024 06:50
Modern SQL Style Guide
layout author title revision version description
default
mattmc3
Modern SQL Style Guide
2019-01-17
1.0.1
A guide to writing clean, clear, and consistent SQL.

Modern SQL Style Guide

@codemedic
codemedic / kinesis-get-records.sh
Last active May 29, 2023 15:40
Get records from a AWS Kinesis Data Stream. It allows you to start iterating from a time in the past.
#!/usr/bin/env bash
if ! aws_bin="$(which aws)" 2>/dev/null; then
echo "aws cli is missing; you can get it from https://aws.amazon.com/cli/"
exit 1
fi
if ! jq_bin="$(which jq)" 2>/dev/null; then
echo "jq is missing; you can get it from https://stedolan.github.io/jq/"
exit 1