Skip to content

Instantly share code, notes, and snippets.

View typeofweb's full-sized avatar
🛒
https://yournextstore.com

Michał Miszczyszyn typeofweb

🛒
https://yournextstore.com
View GitHub Profile
@typeofweb
typeofweb / mn4.cpp
Last active December 17, 2015 00:29 — forked from anonymous/mn4.cpp
#include <iostream>
#include <vector>
using std::cout;
using std::cin;
template <class T>
struct Fun {
const T operator()(T x) { // funkcja
//return -5*x*x*x+8*x*x+3*x-1;
<?
/*
Template Name: XML Template
*/
$qry = $wpdb->get_results("
SELECT SUBSTR(
CONCAT(
REPLACE(
REPLACE(
REPLACE(
#include <iostream>
#include <vector>
#include <bitset>
using std::cout;
using std::vector;
using std::bitset;
void generator_lin (unsigned a, unsigned c, unsigned m, unsigned x0) {
vector <unsigned> przedzialy (10, 0);
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
@typeofweb
typeofweb / gist:4452051
Last active December 10, 2015 15:08
Adds `cls` command which is no more than double clear.
echo "clear && clear" > /usr/local/bin/cls && chmod +x /usr/local/bin/cls
@typeofweb
typeofweb / console_hack.js
Created November 28, 2012 21:28
Remove console.logs from production
for (var i in window.console) {
if (typeof window.console[i] === "function") {
window.console[i] = function(){return!0}
}
}
@typeofweb
typeofweb / webNotification.js
Last active October 7, 2015 21:08
Web Notifications
var showNotification = function (data) {
if (window.webkitNotifications) {
if (!webkitNotifications.checkPermission()) {
var notif = webkitNotifications.createNotification(data.icon, data.title, data.body);
notif.show();
} else {
webkitNotifications.requestPermission(function () {
showNotification(data);
});
}
var routeModule = function (module) {
var routes = {};
routes[module + '/*url'] = 'handleUrl';
routes[module] = 'handleUrl';
var ModuleRouter = Backbone.Router.extend({
routes: routes,
handleUrl: function (url) {
require(['modules/' + module + '/' + module], function (myModule) {
url = url || '';
@typeofweb
typeofweb / gist:3121875
Created July 16, 2012 09:54
Font smoothing
.font-smoothing (@val:antialiased) {
-webkit-font-smoothing: @val;
-moz-font-smoothing: @val;
font-smoothing: @val;
}