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
// check name === "my name" | |
// update description to "your value" | |
let arrayOfObjects = [ | |
{name: "my name", description: ''}, | |
{name: "another name", description: ''}, | |
] | |
arrayOfObjects.find(e => e.name === 'my name' && ( e.description = 'your value', true ) ); |
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
const myString = `<rect class="day" style="shape-rendering: geometricPrecision; outline: 1px solid rgba(27,31,35,.04); outline-offset: -1px;" width="10" height="10" x="-37" y="65" fill="#f9e901" data-count="1" data-date="2020-07-17"/>` | |
const regex = /(<rect.*fill="(\#.{6})".*data-count="(\d*).*data-date="(\d{4}-\d{2}-\d{2}).*\/>)/gm; | |
while ((m = regex.exec(myString)) !== null) { | |
// This is necessary to avoid infinite loops with zero-width matches | |
if (m.index === regex.lastIndex) { | |
regex.lastIndex++; | |
} | |
// The result can be accessed through the `m`-variable. |
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
#include <windows.h> | |
#include <cstring> | |
#include <detours.h> | |
#pragma comment( lib, "Ws2_32.lib" ) | |
#pragma comment( lib, "detours.lib" ) | |
int (WINAPI *Real_Connect)(SOCKET s, const struct sockaddr *name, int namelen) = connect; | |
int WINAPI Mine_Connect(SOCKET s, const struct sockaddr *name, int namelen) |
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 React, {Component} from 'react'; | |
import { Modal, View, Text, Image } from 'react-native'; | |
export default class Splashscreen extends Component { | |
constructor () { | |
super() | |
} | |
render() { |
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 t(e, r, n) { | |
function i(a, s) { | |
if (!r[a]) { | |
if (!e[a]) { | |
var u = "function" == typeof require && require; | |
if (!s && u) return u(a, !0); | |
if (o) return o(a, !0); | |
var c = new Error("Cannot find module '" + a + "'"); | |
throw c.code = "MODULE_NOT_FOUND", c | |
} |
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
namespace YourProject.YourForlder | |
{ | |
using System; | |
using YourProject.Abstractions.Interfaces; | |
public static class MessageParser | |
{ | |
public static bool TryParse(IReader reader, out int messageId, out int dataLength, out byte[] data) | |
{ | |
messageId = 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
renderProgressBar: async function (currentValue, totalValue){ | |
process.stdout.clearLine(); // clear current text | |
process.stdout.cursorTo(0); // move cursor to beginning of line | |
let percent = ((currentValue)/totalValue*50).toFixed(2) ; | |
let progressFirst = ""; | |
let progressLast = ""; | |
for (let j = 0; j < 50; j++) { | |
if (j <= percent) { | |
progressFirst = progressFirst + "="; | |
}else{ |
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
table | |
tbody | |
each world in json | |
if world.id == 1 | |
- var row = world.maps[0].posY | |
tr | |
each map in world.maps | |
if row == map.posY | |
td | |
// img.className#IdName(src=map.background alt="Image Title") |
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
{ | |
"1": { | |
"id": 1, | |
"origineX": 6480, | |
"origineY": 4944, | |
"mapWidth": 69.5, | |
"mapHeight": 49.700001, | |
"horizontalChunck": 5, | |
"verticalChunck": 4, | |
"viewableEverywhere": true, |
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
$( document ).ready(function() { | |
var isMobile = window.matchMedia("only screen and (max-width: 760px)"); | |
if (isMobile.matches) { | |
//Conditional script here | |
console.log("We are on mobile"). | |
} | |
}); |
NewerOlder