Skip to content

Instantly share code, notes, and snippets.

View ram0973's full-sized avatar
:octocat:
Thinking

ram0973 ram0973

:octocat:
Thinking
View GitHub Profile
@oleg-andreyev
oleg-andreyev / Improved Persistent Login Cookie Best Practice.md
Created January 10, 2019 20:44
Improved Persistent Login Cookie Best Practice
# Autogenerated input type of AddComment
input AddCommentInput {
# A unique identifier for the client performing the mutation.
clientMutationId: String
# The Node ID of the subject to modify.
subjectId: ID!
# The contents of the comment.
body: String!
@Ellrion
Ellrion / helpers.php
Last active August 11, 2017 08:27
extended laravel escaping with exclusion some tags
<?php
if (!function_exists('ex')) {
/**
* Escape HTML entities in a string with exclusion some tags.
*
* use in blade template `{!! ex($message, ['br', 'strong']) !!}`
*
* @param string $str
* @param string[] $excluded
@jrgcubano
jrgcubano / funtalk.ps1
Created May 13, 2015 07:21
Fun script powershell to talk with remote computer
# Link: http://www.reddit.com/r/PowerShell/comments/1khn9o/a_fun_script_for_friday_make_your_friends/
# A fun script for Friday - make your friend's computer start talking to him/her (self.PowerShell)
# submitted 1 year ago * by Sinisterly
# A co-worker of mine stumbled upon this nifty blog article on how to make a text-to-speech call using PowerShell.
# The article gives two examples:
# - Call the SAPI.SPVoice COM object
# - Load the reference to System.Speech
# Where can this come in fun? Well, if you throw PSRemoting in, of course! In my testing, if you use the second method (or the pared down script below) you can make your victim's computer start talking to him or her. Here's how you do it:
# 1. Provide a distraction so that your victim leaves their computer unlocked, and make yourself administrator on their workstation (only needed if you aren't already an admin!)
# 2. Enable PSRemoting on their workstation. A method for doing this would be using PSExec:
@greabock
greabock / Волшебный Eloquent.md
Last active April 15, 2024 12:21
Построение моделей

#Волшебный Eloquent. ##Дисклеймер Данный материал абсолютно не претендует на уникальность, и не является попыткой открыть для кого-то Америку. Все ниже изложенное (прямо или косвенно) можно легко почерпнуть из официального мануала. А для чего же оно тогда написано? Попытка подать информацию в чуть более развернутом виде, систематезировать собственные знания, и снять острый приступ графоманства. Если это вдруг окажется кому-то полезным, то мне будет приятно.

##Введение TL;DR
Так уж сложилось, что слоняясь по "интернетам", в поисках сообщников в ограблении банка единомышленников в изучении framework'a Laravel, я забрел в чат хоть и праздно прозябающего, но (стараниями Алексея) живого и дружелюбного Cообщества, и плотно там осел. А через какое-то время заметил, что отвечаю на чьи-то вопросы гораздо чаще, чем задаю их. Хотя мой замысел был иной: изначально, я хотел добраться до "знающих людей" и, как вампир, высосать через чат все и

@sloria
sloria / bobp-python.md
Last active May 12, 2024 06:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@Artem-Mamchych
Artem-Mamchych / lxml example
Created January 18, 2012 22:36
Пример использования lxml
# coding: utf8
xml = '''<?xml version="1.0" encoding="UTF-8"?>
<soft>
<os>
<item name="linux" dist="ubuntu">
This text about linux
</item>
<item name="mac os">
Apple company