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 {EditorState, EditorView, basicSetup} from "@codemirror/basic-setup" | |
import {javascript} from "@codemirror/lang-javascript" | |
const jscode=` | |
// Note: | |
// 1. Use React.something instead of importing something | |
// 2. Container id is 'app' | |
function Counter({initialCount}) { |
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
# lib/tasks/db.rake | |
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90 | |
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6 | |
# | |
# This is the code from the comment: | |
# https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90#gistcomment-2275324 | |
# Made into a fork/separate gist for easier download, with redundant shell-script removed. | |
# | |
# | |
# Usage: |
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
# Update CHANGELOG.md with latest release | |
update-changelog: | |
echo -e "# Changelog\n" >> temp.md | |
rel=$$(gh release list | head -n 1 | awk '{print $$1}'); \ | |
echo "## $$rel" >> temp.md; \ | |
echo "" >> temp.md; \ | |
gh release view --json body $$rel | \ | |
jq --raw-output '.body' | \ | |
grep -v '^## Changelog' | \ | |
sed -e 's/^#/##/g' >> temp.md |
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 | |
# Copied from http://willwarren.com/2014/07/03/roll-dynamic-dns-service-using-amazon-route53/ | |
# Externalizing the zone ID and CNAME | |
if [ -z "$1" ] | |
then | |
echo "The first argument needs to be the Hosted Zone ID, i.e. BJBK35SKMM9OE" | |
exit 1 | |
fi |
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 | |
# | |
# tomcat This shell script takes care of starting and stopping Tomcat | |
# | |
# chkconfig: - 80 20 | |
# | |
### BEGIN INIT INFO | |
# Provides: tomcat | |
# Required-Start: $network $syslog | |
# Required-Stop: $network $syslog |
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/env ruby | |
# bi | |
# Quickly fetch and display info for the given homebrew formula or cask | |
# | |
# perf: | |
# brew info nginx -> 0m1.742s | |
# bi nginx -> 0m0.166s | |
# | |
# Works well with fzf (via brew.fzf) |
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
@echo off | |
IF EXIST c:\windows\temp\ ( | |
forfiles /p "C:\Windows\Temp" /s /m *.* /D -7 /C "cmd /c del /Q @path" | |
) | |
IF EXIST "C:\Users\" ( | |
for /D %%x in ("C:\Users\*") do ( | |
forfiles /p "%%x\AppData\Local\Temp" /s /m *.* /D -7 /C "cmd /c del /Q @path" | |
forfiles /p "%%x\AppData\Local\Microsoft\Windows\Temporary Internet Files" /s /m *.* /D -7 /C "cmd /c del /Q @path" |
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/ruby | |
# | |
# adduser - Unix-like adduser script. Prompts for parameters and uses dscl internally to create | |
# new NetInfo users and groups. | |
# | |
# Chetan Sarva <csarva@pixelcop.net> | |
def next_user_id(start = 700) | |
ids = `dscl . -list /Users UniqueID`.split("\n").map{|s| s =~ /(\d+)$/; $1 }.sort.uniq | |
n = start |
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
--- /opt/vertica/oss/python/lib/python2.7/site-packages/vertica/network/SystemProfileFactory.py.orig 2011-09-15 14:28:14.000000000 -0400 | |
+++ /opt/vertica/oss/python/lib/python2.7/site-packages/vertica/network/SystemProfileFactory.py 2011-09-15 14:29:51.000000000 -0400 | |
@@ -142,8 +142,14 @@ | |
if (res[0] == '0'): | |
opsys = DBinclude.OS_DEBIAN | |
return opsys, host | |
+ | |
+ (status, res) = ssh.execute("grep \"squeeze\" /etc/debian_version", hide=True) | |
+ if (res[0] == '0'): | |
+ opsys = DBinclude.OS_DEBIAN |