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
#!/run/current-system/sw/bin/sh | |
nix-env -iA nixos.git nixos.gnupg nixos.pinentry-curses | |
gpg --receive-keys DE749C31D060A160 | |
echo "$( \ | |
gpg --list-keys \ | |
| grep DE749C31D060A160 -A 1 \ | |
| head -1 | tr -d '[:space:]' \ | |
):6:" | gpg --import-ownertrust; |
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
<?php | |
/** | |
* Stachl | |
* | |
* LICENSE | |
* | |
* This source file is subject to the CC-GNU GPL license that is bundled | |
* with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: | |
* http://creativecommons.org/licenses/GPL/2.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
module Rack | |
class ApiContentType | |
def initialize(app, methods = [:post, :patch], path = /^\/api\/v2+/, content_type = 'application/json') | |
@app = app | |
@methods = (methods.is_a?(Array) ? methods : [methods]).map{ |item| item.to_s.upcase } | |
@path = path | |
@content_type = content_type | |
end | |
def call(env) |
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
Native.implement([Element, Window, Document], { | |
cloneEventsDeep: function(from, type){ | |
if (this.getChildren().length > 0) { | |
this.getChildren().each(function(item, index) { | |
item.cloneEventsDeep(from.getChildren()[index], type); | |
}); | |
this.cloneEvents(from, type); | |
} else { | |
this.cloneEvents(from, type); | |
} |
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 getAnchorBalance(addr) { | |
const contract = 'terra1hzh9vpxhsk8253se0vv5jj6etdvxu3nv8z07zu'; | |
const aUstBalance = JSON.parse(JSON.parse(UrlFetchApp.fetch("https://mantle.terra.dev/?cw20--balance=" + contract, { | |
method: 'post', | |
headers: { 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/json', 'Accept': 'application/json' }, | |
payload: JSON.stringify({ | |
operationName: null, | |
variables: {}, | |
query: `{\n ${contract}: WasmContractsContractAddressStore(ContractAddress: \"${contract}\", QueryMsg: \"{\\\"balance\\\":{\\\"address\\\":\\\"${addr}\\\"}}\") {\n Height\n Result\n __typename\n }\n}\n` | |
}) |
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 createCustomer($first_name, $last_name, $title, $background, $email) { | |
$subdomain = "your-site-subdomain" | |
$username = "your@username.com" | |
$password = "YoUrPaSsWoRd" | |
$body = @" | |
{ | |
"first_name": "$first_name", | |
"last_name": "$last_name", | |
"title": "$title", | |
"background": "$background", |
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 bash | |
# Everything needs to be run as root | |
if [ $(id -u) -ne 0 ]; then | |
printf "Script must be run as root.\n" | |
exit 1 | |
fi | |
OS=$(lsb_release -si) | |
VERSION=$(lsb_release -sc) |
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
var crypto = require('crypto') | |
// site name is your desk.com subdomain | |
, siteName = 'site_name' | |
// api key is generated here: https://your_subdomain.desk.com/admin/channels/support-center/auth_settings | |
, apiKey = 'multipass_token' | |
, data = JSON.stringify({ | |
uid: '19238333', | |
expires: (new Date(Date.now() + 120000)).toISOString(), | |
customer_email: 'john@example.com', |
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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
gem 'desk_api', '0.5.0' | |
gem 'rubyzip', '1.1.0' | |
gem 'open_uri_redirections', '0.1.4' |
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
# download the code from github | |
wget https://raw.githubusercontent.com/authy/authy-ssh/master/authy-ssh | |
# run the install | |
sudo bash authy-ssh install /usr/local/bin | |
# enable it | |
sudo /usr/local/bin/authy-ssh enable `whoami` | |
# test it |
NewerOlder