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
package calculator; | |
public class CalculatorController { | |
private enum Operation { | |
NOP, ADDITION, SUBSTRACTION, MULTIPLICATION, DIVISION | |
} | |
private static final String INIT_DISPLAY_VALUE = "0."; |
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 info.collide.sqlspaces.client.TupleSpace | |
import info.collide.sqlspaces.commons._ | |
object ScalaDom { | |
import scala.xml._ | |
import org.w3c.dom.{Document => JDocument, Node => JNode} | |
import javax.xml.parsers.DocumentBuilderFactory | |
def dom(n: Node): JDocument = { |
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
/* | |
* Copyright 2008 Sun Microsystems, Inc. All rights reserved. | |
* Use is subject to license terms. | |
*/ | |
#ifndef _SYS_ISA_DEFS_H | |
#define _SYS_ISA_DEFS_H | |
/* | |
* This header file serves to group a set of well known defines and to |
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
#undef _FOO1 | |
#undef _FOO2 | |
#undef _FOO2 | |
#undef _BAR1 | |
#undef _BAR2 | |
#undef _BAR3 | |
#define _FOO3 42 |
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/sh | |
GITLAB_URL="https://git.acme.com" | |
PRIVATE_TOKEN="abcde-fghijklmnop" | |
FROM_GROUP_ID=$1 | |
TO_GROUP_ID=$2 | |
ACCESS_LEVEL=40 | |
USERIDS_OF_GROUP=$(curl -s --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" $GITLAB_URL/api/v4/groups/$FROM_GROUP_ID/members| jq ".[].id") | |
for USERID in $USERIDS_OF_GROUP |
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
[my_group] | |
host-1 | |
host-2 | |
host-3 |
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
# requires curl, jq, grep | |
curl -s --head -H "Authorization: Bearer $(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest | grep RateLimit |
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 generated from bitburner |
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
/** @param {NS} ns **/ | |
export async function main(ns) { | |
const delay = ns.args[1] | |
if (delay) { | |
await ns.sleep(delay) | |
} | |
await ns.hack(ns.args[0]) | |
} |
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 { Octokit } from "https://cdn.skypack.dev/@octokit/rest"; | |
import { PERSONAL_ACCESS_TOKEN } from "token.js" | |
// Create a token.js with this content | |
// export const PERSONAL_ACCESS_TOKEN = "ghp_abcdef1234567890" | |
/** @param {NS} ns **/ | |
export async function main(ns) { | |
if (ns.args.length == 0) { | |
ns.tprint("Usage: run gists.js file1 file2 file3 ...") |
OlderNewer