Skip to content

Instantly share code, notes, and snippets.

View vViktorPL's full-sized avatar

Wiktor Toporek vViktorPL

View GitHub Profile
@Ocramius
Ocramius / example.php
Created June 25, 2017 10:40 — forked from hikari-no-yume/example.php
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
($_)->strlen("foo")->var_dump($_);
@paulirish
paulirish / bling.js
Last active May 26, 2025 20:31
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@djavaui
djavaui / social-color
Created November 6, 2014 13:31
Social color variable
@social-adobe : #ff0000;
@social-bitbucket : #205081;
@social-behance : #053eff;
@social-delicious : #205cc0;
@social-dribbble : #ea4c89;
@social-facebook : #3b5998;
@social-flickr : #ff0084;
@social-forrst : #5b9a68;
@social-foursquare : #25a0ca;
@social-googleplus : #db4a39;
@effection
effection / class-macro.js
Last active January 8, 2016 13:37 — forked from disnet/gist:5267782
Better class macro in Sweet.js
/**
* class which allows 'private' (just non-enumerable prototype object) methods and variables
*/
macro class {
case $className { constructor $constParam { $constBodyStatement... } public var {$public_vars ...} private var $private_vars $rest ... } => {
var $className = (function() {
function $className $constParam {
$public_vars ... Object.defineProperty(this, '_private_vars', { configurable: true, enumerable: false, value: $private_vars, writable: false})
@mckamey
mckamey / bezier.js
Created September 25, 2012 16:35
JavaScript port of Webkit CSS cubic-bezier(p1x.p1y,p2x,p2y) and various approximations
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the