Skip to content

Instantly share code, notes, and snippets.

@mjg123
mjg123 / ajax.cljs
Created July 21, 2011 22:43
How to make a json(p) request from ClojureScript using jQuery
(def jquery (js* "$"))
(defn show [msg]
(let [data-as-json ((js* "JSON.stringify") msg nil 4)]
((js* "alert") data-as-json)))
(defn make-js-map
"makes a javascript map from a clojure one"
[cljmap]
(let [out (js-obj)]
@andruu
andruu / index.html
Created December 3, 2012 23:38
Angular.js Tutorial
<!DOCTYPE HTML>
<html lang="en-US" ng-app="Site">
<head>
<meta charset="UTF-8">
<title>Angular.js Tutorial</title>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body {
padding-top:60px;
}
@mark-rushakoff
mark-rushakoff / io_popen_example.rb
Last active December 13, 2015 20:48
How to simultaneously print and capture the output of an external command in Ruby
#!/usr/bin/env ruby
cmd = %q[echo '3...'; sleep 1;
echo '2...'; sleep 1;
echo '1...'; sleep 1;
echo 'Liftoff!']
puts '------ beginning command ------'
output_log = []
IO.popen(cmd).each do |line|
@jmolivas
jmolivas / drupal-8-links.md
Last active December 19, 2015 19:09
Drupal 8 links & resources Drupal 8 Updates, Module Development & Upgrade Drupal 8 Desarrollo y Actualizacion de Módulos
@iamEAP
iamEAP / nightly_workflow.sh
Last active November 3, 2015 10:21
Keep Pantheon test environment up-to-date and squeeky clean
#!/bin/bash
PSITE='your-site-name'
PUUID='aaaaaaaa-1111-bbbb-2222-cccccccccccc'
PEMAIL='your-email@example.com'
PPASS='your-password-here--i-know'
# Authenticate with Terminus
drush pauth $PEMAIL --password=$PPASS
@pricejn2
pricejn2 / drupalcampsc_gist1.sh
Last active December 12, 2015 13:04
(An) Optimal Drupal 7 Module Configuration for Site Performance
#!/bin/bash
# baseline advagg + httprl configuration
$conf['advagg_bundler_active'] = 1;
$conf['advagg_cache_level'] = 1;
$conf['advagg_combine_css_media'] = 0;
$conf['advagg_core_groups'] = 0;
$conf['advagg_css_compressor'] = 2;
$conf['advagg_css_inline_compressor'] = 2;
$conf['advagg_css_inline_compress_if_not_cacheable'] = 1;
@wei2912
wei2912 / intro.lhs
Last active August 29, 2015 14:09
Update with link to my blog.
# Shifted this file to my blog
The new link is on my blog: https://wei2912.github.io/index.html#introduction_to_haskell
I'll update the post on my blog from now on.
---
Introduction to Haskell
---
@janjongboom
janjongboom / gist:94d575526a689687a6b8
Last active February 24, 2023 14:40
Firefox OS / JanOS on Raspberry Pi with GPIO support

This does NOT work on Raspberry Pi 2!

  1. Obtain a 8GB (or bigger) SD Card
  2. Download disk image from http://janos.io/builds/fxos-pi-gpio.img.zip and unzip
  3. Put SD card in your computer
  4. Find out where your SD card is mounted (BE REALLY SURE ITS THE RIGHT DEVICE, IT WILL BE WIPED COMPLETELY!!!), f.e. /dev/disk5 on OSX
  5. On Linux, run: sudo dd bs=4M if=fxos-pi-gpio.img of=/path/to/your/disk
  6. On OSX, run: sudo dd bs=4m if=fxos-pi-gpio.img of=/dev/rdisk5 (do rdisk, not disk here!)
  7. When it's done put it in your Pi and start up
  8. The demo's are wired like this: yellow LED on GPIO2, red LED on GPIO3, button (wire it as pulldown) on GPIO26.
@juampynr
juampynr / README.md
Last active November 9, 2020 18:34
Make Drupal 7 not to redirect to the node display after saving it

Drupal 7's default behavior is to redirect the user to the full display of a node after it has been saved.

If you want to stay in the edit form after saving, add this snippet to a custom module adjusting the module namespace in the two functions.

For Drupal 8 or 9, have a look at the comment below by @zanvidmar.

Acknowledgements

@facine
facine / __INDEX.txt
Last active August 6, 2023 15:33
Drupal 8 - Examples
# Taxonomy terms:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php
# Menu links:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php
# File items:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php
# Nodes: