Skip to content

Instantly share code, notes, and snippets.

View joelgarciajr84's full-sized avatar
:octocat:
Coding like no tomorrow!

Joel Garcia Jr joelgarciajr84

:octocat:
Coding like no tomorrow!
View GitHub Profile
const Thinky = require('thinky')();
const Type = Thinky.type;
// create the model for messages
const Message = Thinky.createModel('Message', {
username: Type.string(),
message: Type.string()
});
@chirag-shinde
chirag-shinde / uploadMethodTwo.php
Last active April 21, 2021 07:39
PHP Script to Upload CSV to MongoDB. Method Two of Two.
<!-- MongoDB has a command named mongoimport which can be used to directly upload a CSV file into a particular collection of
a database with the first line of the csv as the keys and the following rest of the csv as the values for the respective keys
The format of mongoimport is as folllows
"mongoimport --db database_name --collection collection_name --file csv_file_name --type csv"
now we can use variables to store our database and collection's name.
we upload the file to get the filename and it's path and then simple substitute the database_name and collection_name etc
@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
add_filter("gform_address_types", "brazilian_address", 10, 2);
function brazilian_address($address_types, $form_id){
$address_types["brazil"] = array(
"label" => "Brasil",
"country" => "Brasil",
"zip_label" => "CEP",
"state_label" => "Estado",
"states" => array("", "Acre", "Alagoas", "Amapa", "Amazonas","Bahia", "Ceara", "Distrito Federal", "Espirito Santo", "Goias", "Maranhao", "Mato Grosso", "Mato Grosso do Sul", "Minas Gerais", "Para", "Paraiba", "Parana", "Pernambuco", "Piaui", "Roraima", "Rondonia", "Rio de Janeiro", "Rio Grande do Norte", "Rio Grande do Sul", "Santa Catarina", "Sao Paulo", "Sergipe", "Tocantins")
);
@trepmal
trepmal / wpmandrill-ms.php
Last active December 10, 2018 20:56
Network-wide options for wpMandrill. Options in Network Admin > Settings > wpMandrill MS Overwrites any per-site settings. Removes Mandrill from each site's menu (does not prevent direct access via URL).
<?php
/*
* Plugin Name: wpMandrill MS
* Plugin URI: trepmal.com
* Description: Network-wide settings for wpMandrill.
* Version: 2013.04.01
* Author: Kailey Lampert
* Author URI: kaileylampert.com
* License: GPLv2 or later
* TextDomain: wpmandrill-ms
@molinto
molinto / fourSquareAPI.js
Created July 24, 2012 11:05
Titanium FourSquare API Integration
/*
Author: James Shrager (@jshrager)
Intended use: Appcelerator Titanium
Usage: http://www.LearningTitanium.com (@learningTi)
*/
var client_id = "YOUR_CLIENT_ID";
var client_secret = "YOUR_CLIENT_SECRET";
var redirectUri = 'http://YOUR_URL/foursquareCallback.php';
var ui = require('ui/ui');
@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/