Skip to content

Instantly share code, notes, and snippets.

@m-jovanovic
m-jovanovic / .editorconfig
Created June 7, 2023 12:17
Sample editor config with a bunch of rules turned off 😅
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
@kepano
kepano / obsidian-web-clipper.js
Last active May 7, 2024 17:33
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@mrjurin
mrjurin / laravel_post_receive hook
Created October 26, 2020 06:25 — forked from vool/laravel_post_receive hook
Post receive hook for Laravel website deploy
#!/bin/bash
echo "********************"
echo "Post receive hook: Updating website"
echo "********************"
#set the git repo dir
GIT_REPO_DIR=~/git/<repo>.git
echo "The git repo dir is $GIT_REPO_DIR"
class Solution {
public:
vector<int> closestPrimes(int left, int right) {
//Apply sieve of eratosthenes
vector<bool> isPrime(right+1,true);
for(int i=2;i*i<=right;++i){
if(isPrime[i]==true){
for(int j=2;i*j<=right;++j)
isPrime[i*j]=false;
}
@immujahidkhan
immujahidkhan / tips_tricks-ar.json
Last active May 7, 2024 17:32
tips_tricks-ar
[
{
"icon": "",
"en-title": "Android Useful Tricks",
"type": "Tips",
"body": "<center> <h3> 34 نصائح وحيل android للحصول على أقصى استفادة من هاتفك ربما لم تكن تعرف عنها </h3> </center>\n<p>\n نظام تشغيل mobile android من google\n يبدو بسيطًا على السطح ، لكن حفر\n أعمق وتجد العديد من الطرق للاختراق\n انها للراحة والتخصيص.\n تعال معنا ونحن نغوص في android\n نظام التشغيل واستكشاف بعض الرائع\n ميزات خفية.\n <br>\n android هو نظام تشغيل صغير رائع.\n إنها مليئة تمامًا بميزات رائعة ،\n اختراقات رهيبة ، والحيل الموفرة للوقت.\n لكن كم تعرف حقًا\n هاتفك أو جهازك اللوحي؟ بالتأكيد ، يمكنك صنع\n المكالمات الهاتفية وإرسال النصوص ، لكننا نراهن\n هناك شيء ما في هذا المقال\n لم تكن على علم.\n <br>\n android قوي بشكل ملحوظ ،\n نظام تشغيل الهاتف المحمول المبتكر\n في كثير من الأحيان قفزة ios من apple في new\n دعم التكنولوجيا. 5g ، دفع nfc ،\n لوحات مفاتيح مخصصة ... تستمر القائمة. كل\n هذه الوظيفة الحديثة تجعلها\n لنظام التشغيل المعقد ، المت
@JoeCrescoll
JoeCrescoll / post_receive
Last active May 7, 2024 17:31
Post receive hook on a Git bare repo for a Laravel project deploy
#!/bin/bash
# Adapted from https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa
# Changes these variables values
TARGET="/home/poweruser/www/app"
GIT_DIR="/home/poweruser/menufinder.git"
BRANCH="master"
while read oldrev newrev ref
do
function my_custom_post_event () {
$labels = array(
'name' => _x('Event', 'post type general name'),
'singular_name' => _x('Event', 'post type singular name'),
'add_new' => _x('Add new event', 'event'),
'add_new_item' => __('Add new event'),
'edit_item' => __('Edit event'),
'new_item' => __('New event'),
'all_items' => __('All events'),
'view_item' => __('View event'),
@wolfadex
wolfadex / elm-portal.js
Last active May 7, 2024 17:28
A Portal web component for Elm
window.customElements.define("elm-portal", class extends HTMLElement {
// Base custom element stuff
constructor() {
super();
this._targetNode = document.createElement('div');
}
connectedCallback() {
document.querySelector(this.getAttribute("data-target-selector")).appendChild(this._targetNode);
}
@michele-tn
michele-tn / SSH_PlinkConnecting.ps1
Last active May 7, 2024 17:28
Connecting and Loading SSH private keys automatically on plink
# Run as administrator and stays in the current directory
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
}
}
[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"
# Convert from Base64 to EXE
@sqlheisenberg
sqlheisenberg / README.md
Created October 30, 2016 18:34 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index: