Skip to content

Instantly share code, notes, and snippets.

View JesusTheHun's full-sized avatar

Jonathan MASSUCHETTI JesusTheHun

  • Paris
View GitHub Profile
<?php
$list = "
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua and Barbuda
Argentina
Armenia
#!/bin/bash
# PHP 7.0.2
# Pthreads 3.1.5
curl -LsS https://symfony.com/installer -o ./symfony
chmod a+x ./symfony
./symfony new segfault_proof 2.8.2
cd segfault_proof/
mkdir src/AppBundle/Command
<?php
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
require 'vendor/autoload.php';
class MyThread extends Thread
{
public function run()
@JesusTheHun
JesusTheHun / App.js
Created May 22, 2018 10:36
linear gradient dynamic start & end values
import React from 'react';
import {StyleSheet, Text, View, ScrollView, SafeAreaView} from 'react-native';
import {LinearGradient} from "expo";
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
@Import(SecurityProblemSupport.class)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Value("${spring.security.oauth2.client.provider.oidc.issuer-uri}")
private String issuerUri;
private final JwtAuthorityExtractor jwtAuthorityExtractor;
private final SecurityProblemSupport problemSupport;
const {
BaseTransaction,
TransactionError,
utils,
} = require('@liskhq/lisk-transactions');
const _ = require('lodash');
/**
* type asset {
@JesusTheHun
JesusTheHun / Dockerfile.client - npm
Last active September 27, 2021 13:56
React, node, mysql docker compose setup
FROM node:12.15.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
RUN apk --no-cache upgrade && apk --no-cache add alpine-sdk python2 libtool autoconf automake git
COPY . ./
RUN npm ci
ENV NODE_ENV production
@JesusTheHun
JesusTheHun / type.ts
Last active September 23, 2025 10:49
Partial Type Argument Inference
declare function get<Doc, Key extends keyof Doc = infer>();
declare let unknownObj: unknown;
declare let obj: { title: string; description: string };
// CASE 0
const case0 = get(obj, 'description');
// Unchanged: string
// CASE 1
const case1 = get<{ title: string; description: string }>(unknownObj, 'description');
@JesusTheHun
JesusTheHun / local-storage.mock.ts
Created June 16, 2025 08:55
Mock local storage with vitest
import { vi } from 'vitest';
type Vi = typeof vi;
export class LocalStorage {
store!: Record<string, string>;
constructor(vi: Vi) {
Object.defineProperty(this, 'store', {
enumerable: false,