View wget-entire-website.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# get entire website via wget | |
# from https://www.linuxjournal.com/content/downloading-entire-web-site-wget | |
# replace EXAMPLE.COM with your site | |
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ |
View themename_addressfield_formatter__components.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Override addressfield_tokens themeing function | |
// Requires addressfield_tokens module as well as addressfield | |
// Add to template.php and change THEMENAME to name of your theme, then clear cache | |
function THEMENAME_addressfield_formatter__components($vars) { | |
$loc = $vars['address']; | |
$out = ''; | |
// Note added RDFa microdata - https://schema.org/PostalAddress | |
// Organization name if present (nothing in first or last name fields) |
View moodle_rysnc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
# exp_internal 1 ;# uncomment to turn on expect debugging | |
set timeout -1 | |
USER="user" | |
HOST="127.0.0.1" | |
SRC="/src/dir/here" | |
DST="/dst/dir/here" | |
# creates an rsync process that will rsync with excluded directories |
View db_backup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# set user | |
USER="usr" | |
# set port | |
PORT="22" | |
# set remote IP (put yours here) | |
HOST="127.0.0.1" |
View gist:6135556
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DMOZ | |
FIELDS = { | |
"dmoz.csv" => [ | |
Class.new(Object) do | |
def name | |
:title | |
end | |
end.new, | |
Class.new(Object) do | |
def name |
View gist:6135383
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JobExecutor | |
attr_reader :data_store, :fields | |
def initialize(fields) | |
@jobs = [] | |
@threads_working = 0 | |
@lock = Mutex.new | |
@data_store = DataStore.new(fields) | |
@fields = fields |
View gist:6135344
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Task class | |
require 'mysql' | |
module OrgSocGraph | |
FIELDS = { | |
"orgs.csv" => [ | |
Class.new(Object) do | |
def name | |
:description | |
end |
View gist:1562280
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// leadsRoundRobin.trigger: | |
trigger leadRoundRobin on Lead (before insert, before update) { | |
// | |
//Check if assignment owner has changed | |
// | |
Map<Integer,Id> queueIds = new Map<Integer,Id>(); //Trigger index --> Queue ID | |
Integer idx = 0; | |
for (Lead l : Trigger.new) |
View gist:1515657
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Class */ | |
public with sharing class CityvisionContactAssigner { | |
static final Id OWNER_NYOUNG; | |
static final Id OWNER_AWEBB; | |
static { | |
List<User> users = [SELECT Id, Alias FROM User WHERE Alias = 'nyoung' OR Alias = 'awebb' OR Alias = 'MOmori' OR Alias = 'ASears']; | |
for(User u : users) { | |
// Switch which user to use based on whether we are in production environment, since partner users don't carry across to sandboxes. | |
if((CityvisionConstants.onProduction == true && u.Alias == 'nyoung') |
NewerOlder