Skip to content

Instantly share code, notes, and snippets.

View ref.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ServerSideRender.jsx
const {ServerSideRender} = wp.components;
wp.blocks.registerBlockType('test/ssr', {
title: 'Post Archiv',
icon: 'grid-view',
category: 'my-category',
edit(props) {
return (
<ServerSideRender block="test/ssr"/>
)
View AzureADPrivilegedRoles.ps1
# Azure AD PowerShell CmdLets for Managing Privileged Roles
# Connect to Azure AD
Connect-AzureAD
View 1-restify-server-cheatsheet.js
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@rust-play
rust-play / playground.rs
Created Jun 26, 2019
Code shared from the Rust Playground
View playground.rs
#![allow(unused)]
fn main() {
use std::panic;
let result = panic::catch_unwind(|| {
println!("hello!");
});
assert!(result.is_ok());
let result = panic::catch_unwind(|| {
@sagarpreet-chadha
sagarpreet-chadha / mapKnitterLayer.js
Created Jun 26, 2019
Extending Layer in Mapknitter
View mapKnitterLayer.js
L.Icon.MapKnitterIcon = L.Icon.extend({
options: {
iconUrl: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png',
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
iconSize: [12, 21],
iconAnchor: [6, 21],
popupAnchor: [1, -34],
shadowSize: [20, 20]
}
});
@yunshouhu
yunshouhu / art_9.0_oatdump_cdex.patch
Created Jun 26, 2019 — forked from anestisb/art_9.0_oatdump_cdex.patch
Patch for Android Pie ART oatdump to convert CompactDex to StandardDex before exporting
View art_9.0_oatdump_cdex.patch
diff --git a/oatdump/Android.bp b/oatdump/Android.bp
index 71e276d..3d50229 100644
--- a/oatdump/Android.bp
+++ b/oatdump/Android.bp
@@ -35,6 +35,7 @@ art_cc_binary {
shared_libs: [
"libart",
"libart-compiler",
+ "libart-dexlayout",
"libart-disassembler",
@kimmathiassen
kimmathiassen / degrees2meters.js
Last active Jun 26, 2019 — forked from onderaltintas/degrees2meters.js
javascript coordinate conversions between 900913(3857) - 4326(lat lon)
View degrees2meters.js
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
//test
lon= -77.035974
lat = 38.898717
@puneetsethi25
puneetsethi25 / locale.dart
Created Jun 26, 2019
Custom AppLocalization class for localization
View locale.dart
class AppLocalizations {
static Future<AppLocalizations> load(Locale locale) {
final String name = locale.countryCode.isEmpty ? locale.languageCode : locale.toString();
final String localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
return AppLocalizations();
});
}
View KittyStrategies.js
const ethers = require("ethers");
const neo4j = require("neo4j-driver").v1;
async function des_formatID(kittyId, contractFuncs) {
return ethers.utils.bigNumberify(kittyId.toHexString()).toNumber();
}
function vs_formatAvatar(kittyId) {
return 'https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/' + kittyId + '.png';
}
You can’t perform that action at this time.