Skip to content

Instantly share code, notes, and snippets.

View pridemusvaire's full-sized avatar
🎯
Focusing

Pride Musvaire pridemusvaire

🎯
Focusing
View GitHub Profile
@pridemusvaire
pridemusvaire / find-in-json.js
Created October 8, 2016 13:53 — forked from iwek/find-in-json.js
Searching through JSON
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
@pridemusvaire
pridemusvaire / us_geo_chart_google
Created September 30, 2016 14:46 — forked from gerryster/us_geo_chart_google
US State Map using the GeoChart from the Google Chart Tools
// GeoChart from https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart
// Try out by pasting code into: https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['State', 'Foo Factor'],
['US-IL', 200],
['US-IN', 300],
['US-IA', 20],
@pridemusvaire
pridemusvaire / wordFilter.cfm
Created August 30, 2016 15:10 — forked from stevereich/wordFilter.cfm
Form to demonstrate the bad word filter.cfc
<html>
<head>
<title>Bad Word Filter</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script language="JavaScript" type="text/javascript">
$(function(){
$filterBox = $('#filterBox');
$frmWords = $('#frmWords');
$thewords = $('#thewords');
$buttonCheck = $('#buttonCheck').click(function(){
@pridemusvaire
pridemusvaire / README.md
Created August 14, 2016 19:14 — forked from chrislkeller/README.md
Displaying data from a flat JSON file on a Handlebars.js template file rendered with AJAX.

Demo: ajax-handlebars

This repo's location has changed.

@pridemusvaire
pridemusvaire / v3-hello-email.php
Created July 15, 2016 11:02 — forked from sendgrid-gists/v3-hello-email.php
v3 "Hello World" for email, using SendGrid with PHP.
// using SendGrid's PHP Library
// https://github.com/sendgrid/sendgrid-php
<?php
// If you are using Composer
require 'vendor/autoload.php';
// If you are not using Composer (recommended)
// require("path/to/sendgrid-php/sendgrid-php.php");
$from = new SendGrid\Email("Example User", "[email protected]");
@pridemusvaire
pridemusvaire / How To Hide The Select Arrow On Firefox.md
Created June 14, 2016 12:42 — forked from joaocunha/How To Hide The Select Arrow On Firefox.md
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".

This is no longer a bug. I'm keeping the gist for historical reasons, as it helped to get it fixed. Make sure to read the notes by the end of the post.

How to remove hide the select arrow in Firefox using -moz-appearance:none;

TL;DR (or, the fix)

  1. Set -moz-appearance to none. This will "reset" the styling of the element;
  2. Set text-indent to 0.01px. This will "push" the text a tiny bit[1] to the right;
@pridemusvaire
pridemusvaire / frontendDevlopmentBookmarks.md
Created April 7, 2016 12:14 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@havana59er
havana59er / SP2010_create_list_item.html
Created March 28, 2012 18:11
Create a new list item in SharePoint 2010 using javascript
<div>
<label for="myAnnouncement">Announcement</label>
<input id="myAnnouncement" type="text" /><br />
<input type="button" value="Post Announcement" />
</div>
<script type="text/javascript" >
// Use this to delay execution until the file sp.js has loaded. Also a good way to keep your context free of globals.
ExecuteOrDelayUntilScriptLoaded(function() {
// get announcement text