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
<?php | |
$api_url = 'URL'; | |
$token = 'TOKEN'; | |
$curl_url = $api_url . '&token=' . $token; | |
// if you need to pull from a file, otherwise just generate the string | |
$content = file_get_contents('example.xml'); | |
// cURL setup | |
$ch = curl_init($curl_url); |
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
<?php | |
/** | |
* Import submit function | |
*/ | |
function ret_user_import_upload_form_submit($form, &$form_state) { | |
if ($file = file_save_upload($source = 'ret_user_import_csv_file', $validators = array(), $dest = FALSE, $replace = FILE_EXISTS_REPLACE)) { | |
$offset = 0; | |
$headers = _ret_user_import_get_row($file->filepath, $offset); | |
if ($headers === FALSE) { | |
// there needs to be consistency, so enforce the existence of a 'header' row |
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
<?php | |
/** | |
* Programmatic creation of a node - as simple as it gets | |
* | |
* All Drupal nodes require a title; everything is else is optional or | |
* is auto-generated by Drupal upon saving the node to the database. | |
* This node has no extra CCK fields defined; we're simply giving it | |
* a title and a body. The author will be the super-admin user, and its | |
* published status will be "published". |
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
<?php | |
/** | |
* @file Installation for ret reports | |
*/ | |
function ret_report_api_install() { | |
drupal_install_schema('ret_report_api'); | |
} | |
/** |
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 | |
# If on Windows, run this using the Git Bash | |
cd /path/to/git/repo | |
# Create a git bundle which includes only commits from | |
# the commit tagged "last_bundle" up to the present state | |
# of my "master" branch | |
git bundle create my_code.bundle last_bundle..master |
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
require 'rubygems' | |
require 'celerity' | |
require 'hpricot' | |
require 'htmlentities' | |
# You obviously need all of the above gems installed before proceeding | |
user, password, project = ARGV # 'tobi', 'my_password', 'liquid' | |
raise(ArgumentError, "jruby scrape-github-wiki <username> <password> <projectname>") unless user and project and password |
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
(def example-map | |
{:a "foo" :b "bar" :other-stuff | |
{:item-1 ["hello" "clojure"], | |
:item-2 ["hello" "hiccup"], | |
:another-map | |
{:x "foo" :y "bar" :z "baz"}} | |
:c "wowza sauce"}) | |
(defn map-to-html-list | |
"Clojure map to nested HTML list. Optional list-type and wrapper params taken as keywords hiccup understands, and optional sep parameter for the string to show key-value associations" |
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
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeExceptio | |
n: java.lang.IllegalStateException: Var hiccup.core/render-attrs is unbound. | |
at clojure.lang.LazySeq.sval(LazySeq.java:47) | |
at clojure.lang.LazySeq.seq(LazySeq.java:56) | |
at clojure.lang.RT.seq(RT.java:450) | |
at clojure.core$seq.invoke(core.clj:122) | |
at clojure.core$apply.invoke(core.clj:540) | |
at osc_scrape.util$outline_to_html_list.invoke(util.clj:48) | |
at osc_scrape.util$gen_report.invoke(util.clj:82) | |
at osc_scrape.core$start_scrape.invoke(core.clj:137) |
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
(ns foobar | |
(:gen-class | |
:name Foobar | |
:methods [[say-hello [] void]])) | |
(defn -say-hello [] | |
(println "Saying hello from Clojure World!")) | |
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid method name: say-hello (foobar.clj:1) | |
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5376) |
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
(ns osc-scrape.gui | |
(:use [osc-scrape core util]) | |
(:import [javax.swing | |
JFrame JPanel JButton | |
JCheckBox JLabel | |
JOptionPane SwingWorker] | |
net.miginfocom.swing.MigLayout) | |
(:gen-class | |
:main true)) |
OlderNewer