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; | |
class Program | |
{ | |
public class A | |
{ | |
public void print() | |
{ | |
Console.WriteLine("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
function april { | |
param([Switch] $Undo) | |
$customCssPath = "C:/Users/$env:username/AppData/Local/Google/Chrome/User Data/Default/User StyleSheets/Custom.css" | |
$customCss = "body { -webkit-transform: rotate(180deg); }" | |
if ($Undo) | |
{ | |
copy "$customCssPath.backup" $customCssPath | |
} |
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
CUSTOM_CSS_PATH="/Users/$(whoami)/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css" | |
CUSTOM_CSS="body { -webkit-transform: rotate(180deg); }" | |
if [ "$1" = "--undo" ] | |
then | |
mv "$CUSTOM_CSS_PATH.backup" "$CUSTOM_CSS_PATH" | |
else | |
cp "$CUSTOM_CSS_PATH" "$CUSTOM_CSS_PATH.backup" | |
echo $CUSTOM_CSS >> "$CUSTOM_CSS_PATH" | |
fi |
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
// class definition | |
public class JavaClass { | |
// this is a field, also known as class variable | |
private String variableName; | |
// they can also be public, but this is not recommended! | |
public String badVariable; | |
// you can initialize the value in the same step |
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
// Insert jQuery into current page | |
var s = document.createElement("script"); | |
s.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"; | |
document.getElementsByTagName("head")[0].appendChild(s); |
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
public int LostTrainees(int a, int b, int c) | |
{ | |
int lives = 3; | |
int doorsOpened = 0; | |
while (true) | |
{ | |
var result = OpenDoor(b); | |
var weapon = GetWeapon(); | |
switch (result) | |
{ |
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
var intervalId = setInterval(function () { | |
if (condition) { | |
return; | |
} else { | |
clearInterval(intervalId); | |
} | |
alert("I finished"); | |
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
REM Install Chocolatey | |
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin | |
REM Install Tools | |
cinst Firefox && | |
cinst firefoxaurora && | |
cinst ulsviewer && | |
cinst GoogleChrome && | |
cinst GoogleChrome.Canary && | |
cinst opera && |
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
var defer = function () { | |
var value, | |
resolution, | |
handlers = {}; | |
var fulfill = function () { | |
if (resolution) { | |
var handler = handlers[resolution]; | |
if (handler) { | |
handler(); |
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
use std::rand; | |
use std::rand::Rng; | |
use std::str; | |
static TARGET: &'static str = "methinks it is like a weasel"; | |
static ALPHABET: [char, ..26] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', | |
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', | |
's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; |
OlderNewer