Skip to content

Instantly share code, notes, and snippets.

View dvidsilva's full-sized avatar
❤️
Enamorao

Daveed Silva dvidsilva

❤️
Enamorao
View GitHub Profile
@dvidsilva
dvidsilva / gist:8130777
Last active January 1, 2016 10:19
Hide the onion prompt to sign in after you saw 30 articles in a month
$('#gregbox-outer').hide();
$('#gregbox-signInTab').hide();
$('#gregbox-outer').siblings('div')[2].style.display = 'none';
<!doctype html>
<html lang='en-US'>
<head>
<title >This is a website</title>
<meta charset='utf-8'>
<link rel='shortcut icon' href='favicon.ico' />
<meta http-equiv='cleartype' content='on'>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='app.css' />
</head>
(function(){
var script=document.createElement('script');
script.setAttribute('src','http://cssrefresh.frebsite.nl/js/cssrefresh.js');
var head=document.getElementsByTagName('head');
head[0].appendChild(script);
})();
@dvidsilva
dvidsilva / LoadYoutubeVideo
Created January 22, 2014 22:23
Something bla bla bla bla
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
@dvidsilva
dvidsilva / List of common typos
Created February 16, 2014 22:06
# This file contains a number of common English typos: andriod->android
# The remainder of this file contains misspellings from
# http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
# plus some post-processing to fix invalid entries, remove duplicates, etc.
#
# The content is available under the
# "Creative Commons Attribution-ShareAlike License"
# http://creativecommons.org/licenses/by-sa/3.0/
abandonned->abandoned
{
"provider": "ddg",
"query": "cat pircures",
"type": "images",
"results": [
{
"title": "",
"description": "",
"media": {
"url": "gato.png",
@dvidsilva
dvidsilva / angular-google-map-directive
Created March 19, 2014 18:47
Angular directive to embed google maps in your application
#put the map url in a map attribute in the dom element that has this directive.
#it will get the location from the map url and create an iframe
myApp.directive 'gMap', ->
restrict: "EA"
link: (scope, element, attrs)->
if attrs.map
re = /@(-?\d+\.?\d*,-?\d+\.?\d*),([\d]{1,2})z/gi
url = ''
attrs.map.replace re, (match, lat, z)->
z = z || 10
@dvidsilva
dvidsilva / inline js in yii view
Created March 24, 2014 17:57
example on how to add js in a view
//here view code, mostly HTML with php snippets to insert variables
//...
//...
//block with JS code
<?php
<?php
Yii::app()->clientScript->registerScript('settings-script', <<<EOD
FB.Event.subscribe('edge.create', function(response) {
alert('You liked the URL: ' + response);
@dvidsilva
dvidsilva / .vimrc.bundles.local
Created March 26, 2014 00:00
I use https://github.com/square/maximum-awesome for my vim basic config, this two extra files are the local shorcuts and plugins that i add.
Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
Bundle "xolox/vim-misc"
Bundle "xolox/vim-session"
Bundle "vim-multiple-cursors"
Bundle 'groenewege/vim-less'
Bundle 'kchmck/vim-coffee-script'
Hey shibes! you might know by now but there was a terrible fire in Chile, that killed some people and destroyed many houses in an area that was already in not great shape.
http://www.usatoday.com/story/news/world/2014/04/13/forest-fire-chile-homes/7664531/
We've been working a lot in Josh and letting the word out, but we're all about helping others and this is some people that need it.
I'm getting in touch with [Techo](http://www.techo.org/en/) they have the most experience in the country helping in these situations to find a way to send them money from here.
Any cent helps :) in this cases people can benefit from even the cheapest things, since water sources are hard to get to, diapers for kids, etc.