This file contains hidden or 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 - | |
| #argument defaults | |
| x="foo" | |
| y="bar" | |
| # argument handling | |
| while test $# -gt 0 | |
| do | |
| case "$1" in |
This file contains hidden or 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
| vsql -e -w "PasswordHere" -c "\dt" | awk 'BEGIN { FS = "|" } $1 ~ /SchemaNameHere\>/ { for (i=1;i<=NF;i++) gsub (/(^ *)|(\W*$)/,"",$i); print "SELECT '\''" $1 "." $2 "'\'', COUNT(*) FROM " $1 "." $2 ";" }' | vsql -t -w "PasswordHere" | awk '/SchemaNameHere\>/ {print $1 "|" $3}' |
This file contains hidden or 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
| using System; | |
| using System.Web; | |
| using System.Web.Helpers; | |
| namespace CSRF.Infrastructure | |
| { | |
| public class AntiForgerySessionDataProvider : IAntiForgeryAdditionalDataProvider | |
| { | |
| private readonly Func<string, string> _sessionKeyValuePair = sessionId => string.Format("Session: {0}", sessionId); | |
| public string GetAdditionalData(HttpContextBase context) |
This file contains hidden or 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
| git log --pretty=format:"%h%x09%an%x09%ad%x09%s" --graph --date=short > gitlog.txt |
This file contains hidden or 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
| DECLARE @constraints_to_remove TABLE ( | |
| schemaName nvarchar(128) NOT NULL, | |
| tableName sysname NOT NULL, | |
| constraintName sysname NOT NULL); | |
| INSERT @constraints_to_remove ( | |
| schemaName, | |
| tableName, | |
| constraintName) | |
| SELECT |
This file contains hidden or 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
| awk '{gsub (/^[ \t]+|[ \t]+$/,""); print "\"" $0 "\"," > "OUTPUT.csv" }' INPUT.txt |
This file contains hidden or 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
| (defn foo | |
| [arg] | |
| (cond | |
| (string? arg) | |
| (println "a string") | |
| (and (number? arg) | |
| (pos? arg)) | |
| (println "pos arg yo!") |
This file contains hidden or 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
| (defprotocol LNext | |
| (foo [this] [this a] "this is a foo 1") | |
| (bar [this a] "this is a bar")) | |
| (extend-protocol LNext | |
| String | |
| (foo | |
| ([this] (str this " with extra goodness!")) | |
| ([this a] (str this " with double extra goodness!!" a))) |
This file contains hidden or 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 '[clojure.zip :as zip]) | |
| (def v [[[1 2 [3 4]] [:a [[ :b :c] :d]]] ["f" "g"] [[["h"] "i"] "j"]]) | |
| (def z (zip/vector-zip v)) | |
| z | |
| ( -> z zip/node) | |
| ( -> z |
This file contains hidden or 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
| ;Circle | |
| (ns tron.neil.bots | |
| (:require [tron.core :as tron])) | |
| (def directions {:right [1 0] | |
| :down [0 1] | |
| :left [-1 0] | |
| :up [0 -1]}) | |