Skip to content

Instantly share code, notes, and snippets.

View cyrusdavid's full-sized avatar

Cyrus David cyrusdavid

  • Philippines
View GitHub Profile
@cyrusdavid
cyrusdavid / disable-redirect.user.js
Created August 31, 2013 16:28
Disable google search result url tracking on google chrome
// ==UserScript==
// @name Delete onmousedown
// @namespace google
// @include http://www.google.*/*
// ==/UserScript==
var runOnce = function(){
var items = document.querySelectorAll('li.g h3.r a');
for(var i = 0, len = items.length; i< len; i++){
items[i].removeAttribute('onmousedown');
}
<!DOCTYPE html>
<html ng-app="">
<head>
<title>oncopy event example</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
</head>
<body ng-controller="Main">
<div ng-copy="log('Copy blocked!');">Try copying this text!</div>
<h3>Log</h3>
<pre ng-bind="dump"></pre>
/*
AngularJS v1.2.0-rc.3
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
*/
(function(u,c,A){'use strict';function w(c,s,g,b,d){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(l,m,y){return function(p,l,m){function k(){h&&(h.$destroy(),h=null);q&&(d.leave(q),q=null)}function x(){var a=c.current&&c.current.locals,e=a&&a.$template;if(e){var r=p.$new();y(r,function(v){k();v.html(e);d.enter(v,null,l);var f=g(v.contents()),n=c.current;h=n.scope=r;q=v;if(n.controller){a.$scope=h;var p=b(n.controller,a);n.controllerAs&&(h[n.controllerAs]=p);
v.data("$ngControllerController",p);v.children().data("$ngControllerController",p)}f(h);h.$emit("$viewContentLoaded");h.$eval(t);s()})}else k()}var h,q,t=m.onload||"";p.$on("$routeChangeSuccess",x);x()}}}}u=c.module("ngRoute",["ng"]).provider("$route",function(){function u(b,d){return c.extend(new (c.extend(function(){},{prototype:b})),d)}function s(b,c){var l=c.caseInsensitiveMatch,m={originalPath:b,regexp:b},g=m.keys=[];b=b.
[{"name":"teemo","age":15},{"name":"volibear","age":16},{"name":"lee sin","age":17},{"name":"lissandra","age":18},{"name":"caitlyn","age":19}]
@cyrusdavid
cyrusdavid / index.html
Created November 4, 2013 03:01
Emoji Cheatsheet with customizable image size.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<ul class="people emojis" id="emoji-people">
<li>
<?php
return array(
'age' => 34
);
<!doctype html>
<html>
<head>
<title>Lumberjack Demo Page</title>
<script type="text/javascript" src="lumberjack.js"></script>
<script type="text/javascript">
console.log('Lovely day isn\'t it?');
console.stream('dog').info('Hooooooooooowl!!!');
@cyrusdavid
cyrusdavid / index.html
Last active January 1, 2016 01:19 — forked from pelf/snow.html
<!DOCTYPE html>
<head>
<title>Snow</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="snow.js" type="text/javascript"/></script>
</head>
<body onload="init();">
<canvas id="bgcanvas" width="410" height="316" style="position:absolute;z-index:2"></canvas>
<img src="globe_layers_2.png" style="position:absolute;z-index:3">
<canvas id="fgcanvas" width="410" height="316" style="position:absolute;z-index:4"></canvas>
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. Thanks.|
{It is|It's} {appropriate|perfect|the best} time to make some plans for the future and {it is|i
@cyrusdavid
cyrusdavid / nextTickSample.js
Created March 6, 2014 13:55
sample use case of process.nextTick on node.js
function Foo() {
var self = this;
require('events').EventEmitter.call(arguments, this);
// process.nextTick(function() {
self.emit('foo');
// });
}
require('util').inherits(Foo, require('events').EventEmitter);