Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
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
from discord.ext import commands | |
description = '''An example bot to showcase the discord.ext.commands extension | |
module. | |
There are a number of utility commands being showcased here.''' | |
# this specifies what extensions to load when the bot starts up | |
startup_extensions = ["members", "rng"] |
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
CREATE OR REPLACE VIEW dbo.vwdependencies | |
AS | |
SELECT DISTINCT c_p.oid AS tbloid | |
,n_p.nspname AS schemaname | |
,c_p.relname AS NAME | |
,n_c.nspname AS refbyschemaname | |
,c_c.relname AS refbyname | |
,c_c.oid AS viewoid | |
FROM pg_class c_p | |
JOIN pg_depend d_p ON c_p.relfilenode = d_p.refobjid |
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
files: | |
"/tmp/45_nginx_https_rw.sh": | |
owner: root | |
group: root | |
mode: "000644" | |
content: | | |
#! /bin/bash | |
CONFIGURED=`grep -c "return 301 https" /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf` | |
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
#Compile rsync 3.0.7 | |
#Follow these instructions in Terminal on both the client and server to download and compile rsync 3.0.7: | |
#Download and unarchive rsync and its patches | |
cd ~/Desktop | |
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-3.1.2.tar.gz | |
tar -xzvf rsync-3.1.2.tar.gz | |
rm rsync-3.1.2.tar.gz | |
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.1.2.tar.gz |
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
import base64 | |
import os | |
import time | |
""" | |
Writing from Spark to S3 is ridiculously slow. This is because S3 is an object | |
store and not a file system. Because of consistency model of S3, when writing | |
Parquet (or ORC) files from Spark. Data will be stored to a temporary destination | |
then renamed when the job is successful. As S3 is an object store, renaming files | |
is very expensive (complete rewrite). The Spark job will only terminate when all |