View unfollow.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
// Unfollow everyone on twitter who doesn't follow you. | |
// based on: | |
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left) | |
// https://gist.github.com/JamieMason/7580315 | |
// | |
// 1. Go to https://twitter.com/YOUR_USER_NAME/following | |
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac) | |
// 3. Paste this into the Developer Console and run it | |
// |
View gist:db9b34a0a94126adc9edabfc2dd37df9
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
function numberToSocial(bigNum, startAt = 10_000) { | |
return bigNum < startAt ? bigNum : Intl.NumberFormat("en", { | |
notation: "compact", | |
style: "decimal", | |
maximumFractionDigits: 1, | |
roundingMode: "floor", | |
unitDisplay: "narrow", | |
}).format(bigNum) | |
} |
View machine.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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
View machine.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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
View heroku_config.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
{ | |
"root": "build/", | |
"clean_urls": false, | |
"routes": { | |
"/**": "index.html" | |
} | |
} |
View heroku.sh
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
npm install -g create-react-app | |
create-react-app my-app | |
cd my-app | |
git init | |
heroku create -b https://github.com/mars/create-react-app-buildpack.git | |
git add . | |
git commit -m "react-create-app on Heroku" | |
git push heroku master | |
heroku open |
View vgg.py
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
batch_size=64 | |
no_of_epochs=1 | |
# do it | |
vgg = Vgg16() | |
# Grab a few images at a time for training and validation. | |
# NB: They must be in subdirectories named based on their category | |
train_batches = vgg.get_batches(train_path, batch_size=batch_size) | |
val_batches = vgg.get_batches(valid_path, batch_size=batch_size*2) | |
vgg.finetune(train_batches) | |
vgg.model.optimizer.lr = 0.01 |
View header.groovy
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 java.nio.charset.StandardCharsets; | |
import java.security.SignatureException; | |
import java.security.spec.EncodedKeySpec; | |
import com.eviware.soapui.support.types.StringToStringMap; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.UnsupportedEncodingException; | |
import java.security.MessageDigest; | |
import javax.xml.bind.DatatypeConverter; | |
import java.sql.Date.*; |
View swaggeruiconfig.cs
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
.EnableSwaggerUi(c=> | |
{ | |
c.InjectStylesheet(assemblyType, "Api.SwaggerExtensions.swaggeroverrides.css"); | |
c.InjectJavaScript(assemblyType, "Api.SwaggerExtensions.hmac-sha1.js"); | |
c.InjectJavaScript(assemblyType, "Api.SwaggerExtensions.moment.js"); | |
c.InjectJavaScript(assemblyType, "Api.SwaggerExtensions.enc-base64.js"); | |
c.InjectJavaScript(assemblyType, "Api.SwaggerExtensions.sha256.js"); | |
c.InjectJavaScript(assemblyType, "Api.SwaggerExtensions.apihmacheaderauth.js"); |
View swhmac.groovy
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
(function () { | |
$(function () { | |
/*I add the ui elements I need here. I thought it would be better put them in here at runtime rather than hard code them in the index.html in case the index.html from my version of swashbuckle is made obsolete in a future version of the package. */ | |
var hmacAuthUi = | |
' | |
<div class="input"><label for="input_api_username">Api Username: </label><input placeholder="Api Username" id="input_api_username" name="input_api_username" type="text" size="20"></div> | |
' + | |
' | |
<div class="input"><label for="input_api_hmackey">Api Key: </label><input placeholder="ApiKey" id="input_api_hmackey" name="input_api_hmackey" type="text" size="20"></div> |
NewerOlder